|
|
back to boardWhy WA on test 10? Posted by Николай 24 Sep 2013 17:47 #include<iostream> #include<math.h> using namespace std; int main() {int t=0; int a,b,c; int d=0; long A[4001]; long B[4001]; long C[4001]; long D[4001]={0}; cin >> a; if(a <1 || a > 4000) exit(0); for(int i=0;i<a;i++) { cin >> A[i]; if(A[i] < 0 || A[i] >1000000000) exit(0); } cin >> b; if(b < 1 || b > 4000) exit(0); for(int i=0;i<b;i++) { cin >> B[i]; if(A[i] < 0 || B[i] >1000000000) exit(0); } cin >> c; if(c < 1 || c > 4000) exit(0); for(int i=0;i<c;i++) { cin >> C[i]; if(A[i] < 0 || C[i] >1000000000) exit(0); } for(int i=0;i<a;i++) for(int j=0;j<b;j++) if(A[i] == B[j]) { D[i]=A[i]; B[j]=0; t++; break; } for(int i=0;i<t;i++) for(int j=0;j<c;j++) if(D[i] == C[j]) { d++; C[j]=0; break; } cout << d; system("pause"); return 0; } |
|
|