# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
959137 | lalig777 | Marko (COCI15_marko) | C++14 | 37 ms | 1116 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 <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
int main(){
unordered_map<char, char>mapa;
mapa['a']='2'; mapa['b']='2'; mapa['c']='2'; mapa['d']='3'; mapa['e']='3'; mapa['f']='3'; mapa['g']='4'; mapa['h']='4'; mapa['i']='4';
mapa['j']='5'; mapa['k']='5'; mapa['l']='5'; mapa['m']='6'; mapa['n']='6'; mapa['o']='6'; mapa['p']='7'; mapa['q']='7'; mapa['r']='7';
mapa['s']='7'; mapa['t']='8'; mapa['u']='8'; mapa['v']='8'; mapa['w']='9'; mapa['x']='9'; mapa['y']='9'; mapa['z']='9';
int n;
cin>>n;
vector<string>v(n);
vector<bool>val(n, true);
for (int i=0; i<n; i++) cin>>v[i];
string cod;
cin>>cod;
int ans=n;
for (int i=0; i<cod.size(); i++){
char c=cod[i];
for (int j=0; j<n; j++){
string s=v[j];
if (val[j]==false) continue;
if (s.size()<=i){
ans--;
val[j]=false;
}
else if (mapa[s[i]]!=c){
ans--;
val[j]=false;
}
}
}int i=cod.size();
for (int j=0; j<n; j++){
string s=v[j];
if (val[j]==false) continue;
if (s.size()>i) ans--;
}cout<<ans<<endl;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |