#include <bits/stdc++.h>
using namespace std;
string s;
char l[]={'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+=l[in[i]-'a'];}
mp[s]++;
//cout <<s;
s.clear();
}
cin>>s;
cout <<mp[s];
return 0;
}
Compilation message
marko.cpp: In function 'int main()':
marko.cpp:14:23: 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 |
1 ms |
512 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
16 ms |
1004 KB |
Output is correct |
5 |
Correct |
3 ms |
492 KB |
Output is correct |
6 |
Correct |
3 ms |
364 KB |
Output is correct |
7 |
Correct |
10 ms |
876 KB |
Output is correct |
8 |
Correct |
18 ms |
1132 KB |
Output is correct |
9 |
Correct |
3 ms |
364 KB |
Output is correct |
10 |
Correct |
13 ms |
876 KB |
Output is correct |