#include <bits/stdc++.h>
using namespace std;
string s;
char c[26]={'2','2','2','3','3','3','4','4','4','5','5','5','6','6','6','7','7','7','7','8','8','8','9','9','9','9'};
int n;
map<string,int>mp;
int main()
{
cin>>n;
while (n--)
{
string in;
cin>>in;
for(int i=0;i<in.length();i++)
s+=c[in[i]-'a'];
mp[s]++;
s.clear();
}
cin>>s;
cout<<mp[s];
return 0;
}
Compilation message
marko.cpp: In function 'int main()':
marko.cpp:14:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
14 | for(int i=0;i<in.length();i++)
| ~^~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
9 ms |
1156 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
5 ms |
904 KB |
Output is correct |
8 |
Correct |
9 ms |
1156 KB |
Output is correct |
9 |
Correct |
2 ms |
344 KB |
Output is correct |
10 |
Correct |
6 ms |
884 KB |
Output is correct |