# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
23196 |
2017-05-04T11:58:00 Z |
model_code |
Marko (COCI15_marko) |
C++11 |
|
29 ms |
2680 KB |
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <string>
using namespace std;
int n;
vector <string> V;
int dig[] = {0, 3, 3, 3, 3, 3, 4, 3, 4};
char set_digit (char x) {
int digpos = 0;
int pos = x - 'a' + 1;
while (pos > 0)
pos -= dig[digpos++];
return '0' + digpos;
}
int main (void){
cin >> n;
for (int i = 0; i < n; ++i) {
string str;
cin >> str;
for (auto &x: str)
x = set_digit(x);
V.push_back(str);
}
string s;
cin >> s;
int ans = 0;
for (auto x: V)
ans += s == x;
printf("%d\n", ans);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2020 KB |
Output is correct |
2 |
Correct |
0 ms |
2020 KB |
Output is correct |
3 |
Correct |
0 ms |
2020 KB |
Output is correct |
4 |
Correct |
19 ms |
2548 KB |
Output is correct |
5 |
Correct |
3 ms |
2152 KB |
Output is correct |
6 |
Correct |
3 ms |
2152 KB |
Output is correct |
7 |
Correct |
13 ms |
2312 KB |
Output is correct |
8 |
Correct |
29 ms |
2680 KB |
Output is correct |
9 |
Correct |
3 ms |
2152 KB |
Output is correct |
10 |
Correct |
19 ms |
2412 KB |
Output is correct |