# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
167379 | 44442 | Marko (COCI15_marko) | C++11 | 9 ms | 1272 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;
long long n,b,a,ok,okk,minn,e,h,ee,c;
string s[1004],d;
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin>>n;
for(int i=0;i<n;i++){
cin>>s[i];
}
cin>>d;
e=d.size()-1;
for(int i=0;i<n;i++){
ok=1;
h=0;
minn=2;
ee=e;
for(int j=s[i].size()-1;h<minn;j--){
long long f=s[i].size();
minn=min(f,e+1);
c=(int)s[i][j]-96;
if(c<=3){
b=2;
}
else if(c<=6){
b=3;
}
else if(c<=9){
b=4;
}
else if(c<=12){
b=5;
}
else if(c<=15){
b=6;
}
else if(c<=19){
b=7;
}
else if(c<=22){
b=8;
}
else{
b=9;
}
if(((int)d[ee]-48)!=b){
ok=0;
}
h++;
ee--;
}
if(ok){
okk++;
}
}
cout<<okk;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |