# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1013953 | May27_th | Marko (COCI15_marko) | C++17 | 7 ms | 1052 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;
#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 <= 21; i ++) {
mp[char(i + 'a')] = 8;
}
for (int i = 22; i <= 25; 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();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |