From c365bbcc700aaa961ef83ee4883914a6500795c1 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Thu, 19 Nov 2020 17:27:53 +0800 Subject: [PATCH] P7079 [NWRRC2013]Arrangement of Contest R42171430 --- problem/P7079/P7079.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 problem/P7079/P7079.cpp diff --git a/problem/P7079/P7079.cpp b/problem/P7079/P7079.cpp new file mode 100644 index 00000000..8cbffb85 --- /dev/null +++ b/problem/P7079/P7079.cpp @@ -0,0 +1,23 @@ +#include + +using namespace std; + +int main() { + int n, f[105], ans = 0; + string s[105]; + char now = 'A'; + memset(f, 0x00, sizeof(f)); + cin >> n; + for (int i = 0; i < n; i++) { + cin >> s[i]; + } + sort(s, s + n); + for (int i = 0; i < n; i++) { + if (s[i][0] == now) { + ans++; + now++; + } + } + cout << ans << endl; + return 0; +}