답안 #1097

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1097 2013-06-25T06:16:56 Z leecs0503 백신 (KOI13_vaccine) C++
0 / 24
5 ms 1280 KB
#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;
		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");
			for(j=0;j<k;j++){
				printf("%d ",a[0][i+j]);
			}
			return 0;
		}
	}
	printf("NO");


	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1280 KB Output isn't correct
2 Halted 0 ms 0 KB -
3 Halted 0 ms 0 KB -
4 Halted 0 ms 0 KB -
5 Halted 0 ms 0 KB -
6 Halted 0 ms 0 KB -
7 Halted 0 ms 0 KB -
8 Halted 0 ms 0 KB -
9 Halted 0 ms 0 KB -
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1280 KB Output isn't correct
2 Halted 0 ms 0 KB -
3 Halted 0 ms 0 KB -
4 Halted 0 ms 0 KB -
5 Halted 0 ms 0 KB -
6 Halted 0 ms 0 KB -
7 Halted 0 ms 0 KB -
8 Halted 0 ms 0 KB -
9 Halted 0 ms 0 KB -
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1280 KB Output isn't correct
2 Halted 0 ms 0 KB -
3 Halted 0 ms 0 KB -
4 Halted 0 ms 0 KB -
5 Halted 0 ms 0 KB -
6 Halted 0 ms 0 KB -
7 Halted 0 ms 0 KB -
8 Halted 0 ms 0 KB -
9 Halted 0 ms 0 KB -
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1280 KB Output isn't correct
2 Halted 0 ms 0 KB -
3 Halted 0 ms 0 KB -
4 Halted 0 ms 0 KB -
5 Halted 0 ms 0 KB -
6 Halted 0 ms 0 KB -
7 Halted 0 ms 0 KB -
8 Halted 0 ms 0 KB -
9 Halted 0 ms 0 KB -
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 1280 KB Output isn't correct
2 Halted 0 ms 0 KB -
3 Halted 0 ms 0 KB -
4 Halted 0 ms 0 KB -
5 Halted 0 ms 0 KB -
6 Halted 0 ms 0 KB -
7 Halted 0 ms 0 KB -
8 Halted 0 ms 0 KB -
9 Halted 0 ms 0 KB -
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 1280 KB Output isn't correct
2 Halted 0 ms 0 KB -
3 Halted 0 ms 0 KB -
4 Halted 0 ms 0 KB -
5 Halted 0 ms 0 KB -
6 Halted 0 ms 0 KB -
7 Halted 0 ms 0 KB -
8 Halted 0 ms 0 KB -
9 Halted 0 ms 0 KB -
10 Halted 0 ms 0 KB -