Submission #167379

#TimeUsernameProblemLanguageResultExecution timeMemory
16737944442Marko (COCI15_marko)C++11
50 / 50
9 ms1272 KiB
#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 timeMemoryGrader output
Fetching results...