#include<bits/stdc++.h>
using namespace std;
#define i64 long long
#define i128 __int128
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
void Solve(void) {
map<char, int> mp;
for (int i = 0; i < 15; i ++) {
mp[char(i + 'a')] = i/3 + 2;
}
for (int i = 15; i <= 18; i ++) {
mp[char(i + 'a')] = 7;
}
for (int i = 19; i <= 22; i ++) {
mp[char(i + 'a')] = 8;
}
for (int i = 23; i <= 26; i ++) {
mp[char(i + 'a')] = 9;
}
int N; cin >> N;
vector<string> S(N);
for (int i = 0; i < N; i ++) {
cin >> S[i];
}
string pressed; cin >> pressed;
int ans = 0;
for (int i = 0; i < N; i ++) {
if ((int)pressed.size() != (int)S[i].size()) continue;
bool flag = true;
for (int j = 0; j < (int)S[i].size(); j ++) {
// cout << mp[S[i][j]] << " " << pressed[j] - '0' << "\n";
if (mp[S[i][j]] != pressed[j] - '0') {
flag = false;
}
}
ans += flag;
}
cout << ans << "\n";
}
signed main() {
ios_base::sync_with_stdio(false); cin.tie(0);
cout << fixed << setprecision(10);
int Tests = 1; // cin >> Tests;
while (Tests --) {
Solve();
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
6 ms |
1492 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
604 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
860 KB |
Output isn't correct |
8 |
Incorrect |
7 ms |
1548 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
604 KB |
Output isn't correct |
10 |
Incorrect |
5 ms |
1116 KB |
Output isn't correct |