|
|
back to boardI am soory!This is my source I got crash Posted by kkk 17 Apr 2002 17:30 #include<stdio.h> #define N 32768 #define K 10000 void main() { char a[N]; int data,state; long i; state = 0; for(i=0;i < N;i++) a[i] = 0; scanf("%ld",&i); for(;i>0;i--) { scanf("%d", &data); if(data >= 0 && a[data] != 1 && a[data] != 3) a[data]++; else { data = -data - 1; if(a[data] != 2 && a[data] != 3) a[data] += 2; } } scanf("%ld", &i); for(; i > 0; i--) { scanf("%d", &data); if(data >= 0) { if(K - data >= 0) { if(a[K-data] == 1 || a[K-data] == 3) { printf("YES"); state=1; break; } } else { if(a[data-K-1] == 2 || a[data-K-1] == 3) { printf("YES"); state = 1; break; } } } else if((a[K-data] == 1 || a[K-data] == 3) && (K-data) <= 32767) { printf("YES"); state = 1; break; } } if(!state) printf("NO"); } |
|
|