#841
Se consideră un poligon militar, pe care este stabilit un sistem de axe de coordonate xOy
. Se dau n
bombe, numerotate de la 1
la n
, pentru fiecare cunoscându-se coordonatele x y
și puterea de distrugere p
. La explozia unei bombe de putere p
se va distruge totul în interiorul și pe cercul de centru x y
și rază p
, iar dacă există alte bombe în această zonă, vor exploda la rândul lor.
Dându-se numărul de ordine al unei bombe care explodează, să se determine câte bombe rămân intacte la finalul șirului de explozii declanșate.
Problema | Bomber | Operații I/O |
![]() bomber.in /bomber.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58416041 | Utilizator | |
Fișier | bomber.c | Dimensiune | 1.46 KB |
Data încărcării | 03 Iunie 2025, 00:17 | Scor / rezultat | 0 puncte |
bomber.c: In function 'isInExplosionRange': bomber.c:20:13: warning: passing argument 3 of 'distanta' makes integer from pointer without a cast [enabled by default] if(distanta(b->x, b->y, &bombe[i].x, &bombe[i].y) <= (double)b->r){ ^ bomber.c:12:5: note: expected 'int' but argument is of type 'int *' int distanta(int xa, int xb, int ya, int yb){ ^ bomber.c:20:13: warning: passing argument 4 of 'distanta' makes integer from pointer without a cast [enabled by default] if(distanta(b->x, b->y, &bombe[i].x, &bombe[i].y) <= (double)b->r){ ^ bomber.c:12:5: note: expected 'int' but argument is of type 'int *' int distanta(int xa, int xb, int ya, int yb){ ^ bomber.c: In function 'writeOutput': bomber.c:47:5: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int *' [-Wformat=] fprintf(out, "%d", &result); ^ bomber.c: In function 'main': bomber.c:57:5: warning: passing argument 2 of 'readInput' makes pointer from integer without a cast [enabled by default] readInput(fin, n, k, bombe); ^ bomber.c:27:6: note: expected 'int *' but argument is of type 'int' void readInput(FILE *fin, int *n, int *k, Bomba_t bombe[]){ ^ bomber.c:57:5: warning: passing argument 3 of 'readInput' makes pointer from integer without a cast [enabled by default] readInput(fin, n, k, bombe); ^ bomber.c:27:6: note: expected 'int *' but argument is of type 'int' void readInput(FILE *fin, int *n, int *k, Bomba_t bombe[]){ ^ bomber.c: In function 'readInput': bomber.c:28:11: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf(fin, "%d %d", n, k); ^ bomber.c:30:15: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf(fin, "%d %d %d", &bombe[i].x, &bombe[i].y, &bombe[i].r); ^ bomber.c: In function 'main': bomber.c:57:14: warning: 'k' is used uninitialized in this function [-Wuninitialized] readInput(fin, n, k, bombe); ^ bomber.c:57:14: warning: 'n' is used uninitialized in this function [-Wuninitialized]
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Caught fatal signal 11 | 20 | 0 | Exemplu | |
2 | 0 secunde | Caught fatal signal 11 | 40 | 0 | ||
3 | 0 secunde | Caught fatal signal 11 | 40 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Bomber face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.