# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
171866 | ToniB | Marko (COCI15_marko) | C++14 | 113 ms | 1656 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 <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(){
int br[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};
char slova[26];
for(int i = 0; i < 26; ++i){
slova[i] = i + 97;
}
int n;
cin >> n;
string r[n];
int sl[n] = {0};
for(int i = 0; i < n; ++i){
cin >> r[i];
}
string s;
cin >> s;
for(int i = 0; i < s.length(); ++i){
for(int j = 0; j < n; ++j){
string rijec = r[j];
if(rijec.length() == s.length()){
int ind = 0;
int ind2 = s[i] - 48;
for(int k = 0; k < 26; ++k){
if(rijec[i] == slova[k]){
ind = br[k];
if(ind == ind2) sl[j]++;
}
}
}
}
}
int sol = 0;
for(int i = 0; i < n; ++i){
if(sl[i] == s.length()) sol++;
}
cout << sol;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |