|
|
вернуться в форумI only what to know why? this code is right #include<stdio.h> int arry[150000]; char brry[150000]; int main() { int n,i,j; scanf("%d",&n); for(i=0;i<n;++i) scanf("%d%d",&arry[i],&brry[i]); for(i=100;i>=0;--i) for(j=0;j<n;++j) if(brry[j]==i) printf("%d %d\n",arry[j],brry[j]); } but this is wrong #include<stdio.h> int main() { int arry[150000]; char brry[150000]; int n,i,j; scanf("%d",&n); for(i=0;i<n;++i) scanf("%d%d",&arry[i],&brry[i]); for(i=100;i>=0;--i) for(j=0;j<n;++j) if(brry[j]==i) printf("%d %d\n",arry[j],brry[j]); } Local data is stored in stack which size is not so large as heap. Re: I only what to know why? stack overflow Re: I only what to know why? Yeah but the Timus compilator is GNU |
|
|