# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
104669 | MatesV13 | Marko (COCI15_marko) | C++11 | 16 ms | 1484 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 <bits/stdc++.h>
using namespace std;
int n;
string w[1005], s;
bool ok[1005];
int tonum(char x){
if (x=='a') return 2;
if (x=='b') return 2;
if (x=='c') return 2;
if (x=='d') return 3;
if (x=='e') return 3;
if (x=='f') return 3;
if (x=='g') return 4;
if (x=='h') return 4;
if (x=='i') return 4;
if (x=='j') return 5;
if (x=='k') return 5;
if (x=='l') return 5;
if (x=='m') return 6;
if (x=='n') return 6;
if (x=='o') return 6;
if (x=='p') return 7;
if (x=='q') return 7;
if (x=='r') return 7;
if (x=='s') return 7;
if (x=='t') return 8;
if (x=='u') return 8;
if (x=='v') return 8;
if (x=='w') return 9;
if (x=='x') return 9;
if (x=='y') return 9;
if (x=='z') return 9;
}
int main (){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i=0;i<n;i++){
cin >> w[i];
ok[i]++;
}
cin >> s;
for (int i=0;i<s.size();i++){
for (int j=0;j<n;j++){
if (tonum(w[j][i]) != (int)s[i] - (int)'0') ok[j]=0;
}
}
int ans=0;
for (int i=0;i<n;i++) ans+=ok[i];
cout << ans;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |