#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
unordered_map<string, int> dictionary;
dictionary.reserve(n);
while (n--) {
string s, new_s = "";
cin >> s;
for (char c : s) {
if (c <= 'c') new_s += '2';
else if (c <= 'f') new_s += '3';
else if (c <= 'i') new_s += '4';
else if (c <= 'l') new_s += '5';
else if (c <= 'o') new_s += '6';
else if (c <= 's') new_s += '7';
else if (c <= 'v') new_s += '8';
else new_s += '9';
}
dictionary[new_s]++;
}
string s;
cin >> s;
cout << dictionary[s] << '\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
612 KB |
Output is correct |
4 |
Correct |
11 ms |
968 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
8 ms |
860 KB |
Output is correct |
8 |
Correct |
11 ms |
1112 KB |
Output is correct |
9 |
Correct |
2 ms |
348 KB |
Output is correct |
10 |
Correct |
10 ms |
956 KB |
Output is correct |