Submission #999230

# Submission time Handle Problem Language Result Execution time Memory
999230 2024-06-15T08:27:38 Z AliHasanli Marko (COCI15_marko) C++17
50 / 50
9 ms 1156 KB
#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++)
      |                     ~^~~~~~~~~~~~
# Verdict Execution time Memory 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