답안 #7407

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
7407 2014-08-05T03:13:03 Z gs13068 백신 (KOI13_vaccine) C++
0 / 24
92 ms 2260 KB
#include<cstdio>
#include<algorithm>

int a[100][1000];
int an[100];

long long key[100][1000];

long long hash(int i,int j,int k)
{
  long long res=0;
  int t;
  for(t=0;t<k;t++)res=res*10000+a[i][j+t];
  return res;
}

long long hash2(int i,int j,int k)
{
  long long res=0;
  int t;
  for(t=1;t<=k;t++)res=res*10000+a[i][j+k-t];
  return res;
}

int main()
{
  int i,j,n,m;
  scanf("%d%d",&n,&m);
  for(i=0;i<n;i++)
  {
    scanf("%d",&an[i]);
    for(j=0;j<an[i];j++)scanf("%d",&a[i][j]);
  }
  for(i=0;i<n;i++)for(j=0;j<an[i]-m+1;j++)
  {
    key[i][j*2]=hash(i,j,m);
    key[i][j*2+1]=hash(i,j,m);
  }
  for(i=0;i<n;i++)std::sort(a[i],a[i]+2*(an[i]-m+1));
  for(j=0;j<2*(an[i]-m+1);j++)
  {
    for(i=1;i<n;i++)if(!std::binary_search(a[i],a[i]+2*(an[i]-m+1),a[0][j]))break;
    if(i==n)break;
  }
  if(j==2*(an[i]-m+1))puts("NO");
  else puts("YES");
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2260 KB Output is correct
2 Correct 0 ms 2260 KB Output is correct
3 Correct 0 ms 2260 KB Output is correct
4 Correct 0 ms 2260 KB Output is correct
5 Incorrect 0 ms 2260 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2260 KB Output is correct
2 Correct 0 ms 2260 KB Output is correct
3 Correct 0 ms 2260 KB Output is correct
4 Incorrect 0 ms 2260 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2260 KB Output is correct
2 Correct 0 ms 2260 KB Output is correct
3 Correct 0 ms 2260 KB Output is correct
4 Correct 0 ms 2260 KB Output is correct
5 Incorrect 0 ms 2260 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2260 KB Output is correct
2 Correct 0 ms 2260 KB Output is correct
3 Correct 0 ms 2260 KB Output is correct
4 Incorrect 0 ms 2260 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 2260 KB Output is correct
2 Correct 8 ms 2260 KB Output is correct
3 Correct 16 ms 2260 KB Output is correct
4 Incorrect 92 ms 2260 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 2260 KB Output is correct
2 Correct 64 ms 2260 KB Output is correct
3 Correct 92 ms 2260 KB Output is correct
4 Incorrect 32 ms 2260 KB Output isn't correct
5 Halted 0 ms 0 KB -