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

Help! Memory used is negative??????? and crash some more!!!!
Posted by abc 1 Feb 2003 20:06
Online Status
ID Date Author Problem Language Status Time Worked Memory Usage
319006 15:01:09
1 Feb 2003  abc 1100 C++ Crash (ACCESS_VIOLATION) 0.02 sec -70K


Memory used is -70K ??????? How can it be possible? Help! and why my
code gets crash?????????????????

The following is my code:

#include<stdio.h>
#define maxn 150005L

typedef unsigned char byte;

void main(){
    long n,i,a;
    int j,b;
    long id[maxn];
    byte num[maxn];

    scanf("%ld",&n);
    for(i=0L; i<n; i++){
        scanf("%ld%d",&a,&b);
        id[i] = a;
        num[i] = b;
    }
    for(j=100; j>=0; j--)
         for(i=0L; i<n; i++)
        if(num[i] == j)
            printf("%ld %d\n",id[i], num[i]);
}

Oh there's really a small bug in my program. Now i get AC.
Posted by abc 1 Feb 2003 20:53