# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
397477 | Iwanttobreakfree | Marko (COCI15_marko) | C++17 | 32 ms | 1028 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main(){
int n;
string str,id;
cin>>n;
map<char,char> tradu;
map<string,int> words;
char c='a';
for(int i=0;i<26;i++){
if(i<3)tradu.insert(make_pair(c,'2'));
else if(i<6)tradu.insert(make_pair(c,'3'));
else if(i<9)tradu.insert(make_pair(c,'4'));
else if(i<12)tradu.insert(make_pair(c,'5'));
else if(i<15)tradu.insert(make_pair(c,'6'));
else if(i<19)tradu.insert(make_pair(c,'7'));
else if(i<22)tradu.insert(make_pair(c,'8'));
else tradu.insert(make_pair(c,'9'));
c++;
}
while(n--){
id="";
cin>>str;
int m=str.length();
for(int i=0;i<m;i++){
id+=tradu[str[i]];
}
if(words.find(id)==words.end())words.insert(make_pair(id,1));
else words[id]++;
}
cin>>str;
if(words.find(str)==words.end())cout<<0;
else cout<<words[str];
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |