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

I only what to know why?
Posted by windbells 28 Jul 2004 22:28
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.
Posted by Vladimir Yakovlev (USU) 28 Jul 2004 22:57
Re: I only what to know why?
Posted by Tomas Dzetkulic 2 Nov 2004 19:31
stack overflow
Re: I only what to know why?
Posted by Nazgul ( Ivan Nicolae ) 27 Mar 2005 18:39
 Yeah but the Timus compilator is GNU