| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1298654 | tab | Marko (COCI15_marko) | C++20 | 17 ms | 4140 KiB |
#include "bits/stdc++.h"
using namespace std;
#define intt int
#define fi first
#define se second
const intt mxN = 1e5 + 5;
const intt LG = 20;
const intt inf = 1e18;
const intt mod = 10007;
intt n;
vector<string> a(mxN);
map<char,intt> mp;
string press;
void _() {
cin >> n;
a.resize(n);
for(intt i = 0; i < n; i++) {
cin >> a[i];
}
cin >> press;
intt idx = 2, c = 0;
for(char i = 'a'; i <= 'z'; i++) {
if(idx == 7 || idx == 9) {
if(c != 4) {
mp[i] = idx;
c++;
} else {
mp[i] = ++idx;
c = 1;
}
} else {
if(c != 3) {
mp[i] = idx;
c++;
} else {
mp[i] = ++idx;
c = 1;
}
}
// cout << i << " " << mp[i] << endl;
}
intt ans =0;
for(intt i = 0; i < n; i++) {
string c = "";
for(intt j = 0; j < (intt)a[i].size(); j++) {
c += (mp[a[i][j]] + '0');
}
// cout << c<< endl;
if(c == press) {
ans++;
}
}
cout << ans << endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
intt t = 1, buu = 1;
// cin >> t;
while(t--){
// cout << "Case #" << buu++ << ": ";
_();
}
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
