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 think test case is wrong
Posted by TheBlaNK 10 Feb 2002 03:30
this problem it tell that N<150000
but why this program is wrong

#include <stdio.h>
#define MAX 150000
int main()
{
 long num[MAX]={0};
 unsigned char m[MAX]={0};
 long n,i,j;
 scanf("%ld",&n);
  for(i=0;i<n;i++)
   {
    scanf("%ld %d",&num[i],&m[i]);
   }
 for(i=100;i>=0;i--)
    for(j=0;j<n;j++)
    if(m[j]==i) printf("%ld %ld\n",num[j],i);
 return 0;
}

but this program is right

#include <stdio.h>
#define MAX 150001
int main()
{
 long num[MAX]={0};
 unsigned char m[MAX]={0};
 long n,i,j;
 scanf("%ld",&n);
  for(i=0;i<n;i++)
   {
    scanf("%ld %d",&num[i],&m[i]);
   }
 for(i=100;i>=0;i--)
    for(j=0;j<n;j++)
    if(m[j]==i) printf("%ld %ld\n",num[j],i);
 return 0;
}
Re: i think test case is wrong
Posted by pittycat 10 Feb 2002 12:50
i think so!