Submission #1099

#TimeUsernameProblemLanguageResultExecution timeMemory
1099leecs0503백신 (KOI13_vaccine)C++98
13.68 / 24
1000 ms1280 KiB
#include<stdio.h> int a[101][1001]; int b[101]; int main(){ int n,k,i,j,p,q; bool flag1,flag2,flag3,flag4,flag5,flag6; scanf("%d%d",&n,&k); for(i=0;i<n;i++){ scanf("%d",&b[i]); for(j=0;j<b[i];j++){ scanf("%d",&a[i][j]); } } for(i=0;i<b[0]-k+1;i++){ flag1=1; if(i==2) int sp=1; for(j=1;j<n;j++){ flag2=0; flag3=0; for(p=0;p<b[j]-k+1;p++){ if(a[0][i]==a[j][p]){ flag2=1; for(q=0;q<k;q++){ if(a[0][i+q]!=a[j][p+q]){ flag2=0; break; } } if(flag2) break; } } for(p=k-1;p<b[j];p++){ if(a[0][i]==a[j][p]){ flag3=1; for(q=0;q<k;q++){ if(a[0][i+q]!=a[j][p-q]){ flag3=0; break; } } if(flag3) break; } } if(flag2==0&&flag3==0) flag1=0; } if(flag1==1){ printf("YES"); return 0; } } printf("NO"); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...