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