#922
Se dau coordonatele carteziene a n puncte în plan. Să se determine distanța maximă dintre un punct dat și originea sistemului de coordonate și numărul de puncte situate la acea distanță față de origine.
| Problema | Puncte | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64320672 | Utilizator | |
| Fișier | puncte.cpp | Dimensiune | 538 B |
| Data încărcării | 29 Aprilie 2026, 14:46 | Scor/rezultat | Eroare de compilare |
puncte.cpp:6:1: error: expected unqualified-id before ‘{’ token 6 | { int x,y;} | ^ puncte.cpp:7:18: error: ‘p’ has incomplete type 7 | double dis(punct p) | ~~~~~~^ puncte.cpp:5:8: note: forward declaration of ‘struct punct’ 5 | struct punct; | ^~~~~ puncte.cpp: In function ‘int main()’: puncte.cpp:14:11: error: elements of array ‘punct p [101]’ have incomplete type 14 | punct p[101]; | ^ puncte.cpp:14:11: error: storage size of ‘p’ isn’t known puncte.cpp:17:40: error: ‘P’ was not declared in this scope 17 | for(int i=0;i<n;i++){ double d=dis(P[i]); | ^ puncte.cpp:22:27: error: ‘else’ without a previous ‘if’ 22 | else if(d==dismax) k++; | ^~~~ puncte.cpp:22:35: error: ‘d’ was not declared in this scope 22 | else if(d==dismax) k++; | ^ puncte.cpp: At global scope: puncte.cpp:24:4: error: ‘cout’ does not name a type 24 | cout<<d<<" "; | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Puncte 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ă.