# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1013953 | May27_th | Marko (COCI15_marko) | C++17 | 7 ms | 1052 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |