Submission #94318

# Submission time Handle Problem Language Result Execution time Memory
94318 2019-01-17T17:09:06 Z theknife2001 Marko (COCI15_marko) C++17
50 / 50
20 ms 1656 KB
#include <iostream>

using namespace std;
const int N=1055;
string s[N];
string a;

int main()
{
    a="22233344455566677778889999";
    int n;
    cin>>n;
    string t;
    for(int i=0;i<n;i++)
    {
        cin>>t;
        for(int j=0;j<t.size();j++)
        {
            s[i]+=a[t[j]-'a'];
        }
    }
    cin>>t;
    int ans=0;
    for(int i=0;i<n;i++)
    {
        if(s[i].size()!=t.size())
            continue ;
        for(int j=0;j<s[i].size();j++)
        {
            if(t[j]!=s[i][j])
            {
                ans--;
                break;
            }
        }
        ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Compilation message

marko.cpp: In function 'int main()':
marko.cpp:17:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=0;j<t.size();j++)
                     ~^~~~~~~~~
marko.cpp:28:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=0;j<s[i].size();j++)
                     ~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 372 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 20 ms 1528 KB Output is correct
5 Correct 4 ms 504 KB Output is correct
6 Correct 4 ms 476 KB Output is correct
7 Correct 11 ms 1020 KB Output is correct
8 Correct 20 ms 1656 KB Output is correct
9 Correct 4 ms 504 KB Output is correct
10 Correct 15 ms 1144 KB Output is correct