|
|
вернуться в форумI can't understand,that why WA on test 1!!!???? It's my solution: #include<iostream> #include<stdio.h> #include<time.h> using namespace std; int main() { #ifndef ONLINE_JUDGE time_t start,end; start=clock(); freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif int a,b,c,d=0,i,j; int *m,*m1; m=new int [100000000]; m1=new int [100000000]; cin>>a; for(i=0;i<a;i++) cin>>m[i]; cin>>b; for(i=0;i<b;i++) cin>>m1[i]; for(i=0;i<a;i++) { c=m[i]; for(j=0;j<b;j++) if(m[i]==m[j]){ m[j]=0; d++; } } cout<<d; delete [] m; delete [] m1; return 0; } Это решение даёт правильный ответ,но не проходит... Почему???? Re: I can't understand,that why WA on test 1!!!???? Послано Noob 16 май 2011 11:18 I can't understand it too. It should be MLE: m=new int [100000000]; or TLE: for(i=0;i<a;i++) ... for(j=0;j<b;j++) Re: I can't understand,that why WA on test 1!!!???? maybe you shouldn't use freopen... |
|
|