#841
Bomber
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 | #58372470 | Utilizator | |
Fișier | bomber.c | Dimensiune | 1.87 KB |
Data încărcării | 29 Mai 2025, 22:46 | Scor / rezultat | Eroare de compilare |
bomber.c: In function 'read_input': bomber.c:28:9: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration] exit(1); ^ bomber.c:28:9: warning: incompatible implicit declaration of built-in function 'exit' [enabled by default] bomber.c:33:13: warning: incompatible implicit declaration of built-in function 'exit' [enabled by default] exit(1); ^ bomber.c: In function 'writeout': bomber.c:50:5: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int *' [-Wformat=] fprintf(fout, "%d", &result); ^ bomber.c: In function 'main': bomber.c:60:9: warning: incompatible implicit declaration of built-in function 'exit' [enabled by default] exit(1); ^ bomber.c:66:9: warning: incompatible implicit declaration of built-in function 'exit' [enabled by default] exit(1); ^ bomber.c:72:5: warning: passing argument 2 of 'writeout' makes integer from pointer without a cast [enabled by default] writeout(fout, &result); ^ bomber.c:49:6: note: expected 'int' but argument is of type 'int *' void writeout(FILE *fout, int result){ ^ bomber.c:75:5: warning: implicit declaration of function 'fclsoe' [-Wimplicit-function-declaration] fclsoe(fout); ^ /tmp/ccQtaYC6.o: In function \`main': bomber.c:(.text.startup+0xeb): undefined reference to \`fclsoe' collect2: error: ld returned 1 exit status
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ă.