Submission #959135

#TimeUsernameProblemLanguageResultExecution timeMemory
959135AriadnaMarko (COCI15_marko)C++14
50 / 50
11 ms1112 KiB
#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; }
#Verdict Execution timeMemoryGrader output
Fetching results...