ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1100. Final Standings

Crash (stack overflow)???
Posted by Daniel Ribeiro Albert 20 Sep 2008 10:09
does anyone knows what am I doing wrong???

here's my code in C.

#include <stdio.h>

int main()
{
       long N,i,j;

       long ID[150000];

       int M[150000];

       scanf("%ld",&N);

       for (i=0;i<N;i++){
           scanf("%ld %d",&ID[i],&M[i]);
       }

       for (i=100;i>=0;i--){
           for (j=0;j<N;j++){
               if (M[j] == i){
                  printf("%ld %d\n",ID[j],M[j]);
               }
           }
       }

       return 0;
}
Re: Crash (stack overflow)???
Posted by SAeiD Aghapour 22 Oct 2008 02:20
Dynamic allocation , is the way.