Borderou de evaluare (job #3351694)

Utilizator Iustinaaa2Ciobano Iustina Iustinaaa2 Data 20 aprilie 2026 20:53:20
Problema Inv Status done
Runda Arhiva de probleme Compilator c-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.c: In function 'main': main.c:51:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 51 | int a = (int)malloc(n * sizeof(int)); | ^ main.c:52:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 52 | int t = (int)malloc(n * sizeof(int)); | ^ main.c:54:11: warning: comparison between pointer and integer 54 | if (a == NULL || t == NULL) { | ^~ main.c:54:24: warning: comparison between pointer and integer 54 | if (a == NULL || t == NULL) { | ^~ main.c:55:21: warning: passing argument 1 of 'free' makes pointer from integer without a cast [-Wint-conversion] 55 | if (a) free(a); | ^ | | | int In file included from main.c:2: /usr/include/stdlib.h:568:25: note: expected 'void *' but argument is of type 'int' 568 | extern void free (void *__ptr) __THROW; | ~~~~~~^~~~~ main.c:56:21: warning: passing argument 1 of 'free' makes pointer from integer without a cast [-Wint-conversion] 56 | if (t) free(t); | ^ | | | int /usr/include/stdlib.h:568:25: note: expected 'void *' but argument is of type 'int' 568 | extern void free (void *__ptr) __THROW; | ~~~~~~^~~~~ main.c:62:29: error: subscripted value is neither array nor pointer nor vector 62 | fscanf(fin, "%d", &a[i]); | ^ main.c:66:32: warning: passing argument 1 of 'solve' makes pointer from integer without a cast [-Wint-conversion] 66 | long long rezultat = solve(a, t, 0, n - 1); | ^ | | | int main.c:27:22: note: expected 'int *' but argument is of type 'int' 27 | long long solve(int *a, int *t, int st, int dr) { | ~~~~~^ main.c:66:35: warning: passing argument 2 of 'solve' makes pointer from integer without a cast [-Wint-conversion] 66 | long long rezultat = solve(a, t, 0, n - 1); | ^ | | | int main.c:27:30: note: expected 'int *' but argument is of type 'int' 27 | long long solve(int *a, int *t, int st, int dr) { | ~~~~~^ main.c:74:10: warning: passing argument 1 of 'free' makes pointer from integer without a cast [-Wint-conversion] Non zero exit status: 1

Ceva nu functioneaza?