Strange Compile Error

The forum to report every bug you find or tell us what you'd like to find in UVa OJ

Moderator: Board moderators

Locked
Stephan.Ritscher
New poster
Posts: 5
Joined: Wed May 17, 2006 4:00 pm

Strange Compile Error

Post by Stephan.Ritscher »

During the last contest I submitted the code attached at the end.
The Compile Error reported to me by UVA was (in the notification email)
g++: 00003755_PC.c: No such file or directory
g++: No input files
This is not the correct error. Now, after the contest, I receive the correct one:
04799290_24.c: In function `int cmp(const void *, const void *)':
04799290_24.c:28: implicit declaration of function `int strcasecmp(...)'
Why are the errors during the contest different? In my opinion at least compile errors should be reported correctly, because not everyone can set up the compiler used by the judge.

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

struct pilot_t {
        char name[100];
        int x, y, z;
} pilots[110];

int cmp(const void *a, const void *b)
{
        pilot_t *l = (pilot_t *) a, *r = (pilot_t *) b;
        if (l->x != r->x) return l->x - r->x;
        if (l->y != r->y) return l->y - r->y;
        if (l->z != r->z) return l->z - r->z;
        return strcasecmp(l->name, r->name);
}

int main()
{
        int n, i;
        while (scanf("%d", &n) == 1) {
                if (n == 0) break;
                for (i = 0; i < n; i++) {
                        assert(scanf("%s : %d min %d sec %d ms", pilots[i].name, &pilots[i].x, &pilots[i].y, &pilots[i].z) == 4);
                        assert(pilots[i].x >= 0 && pilots[i].x < 60);
                        assert(pilots[i].y >= 0 && pilots[i].y < 60);
                        assert(pilots[i].z >= 0 && pilots[i].z < 1000);
                        /*for (int j = 0; j < (int) strlen(pilots[i].name); j++) {
                                assert(pilots[i].name[j] >= 'A' && pilots[i].name[j] <= 'Z' 
                                        || pilots[i].name[j] >= 'a' && pilots[i].name[j] <= 'z');
                        }*/
                }
                qsort(pilots, n, sizeof(pilot_t), cmp);
                for (i = 0; i < n; i++) {
                        if (i % 2 == 0) {
                                printf("Row %d\n", i / 2 + 1);
                        }
                        printf("%s\n", pilots[i].name);
                        
                }
                printf("\n");
        }
        return 0;
}
Carlos
System administrator
Posts: 1286
Joined: Sat Oct 13, 2001 2:00 am
Location: Valladolid, Spain
Contact:

Post by Carlos »

This was an old error that appeared during the contests; I didn't know it still showed some times. Unfortunately, we don't know why it produces, and we won't try to solve it.

This kind of errors will be solved once the new system is born :-)
DON'T PM ME --> For any doubt, suggestion or error reporting, please use the "Contact us" form in the web.
Locked

Return to “Bugs and suggestions”