#285
Se dă un număr natural, k. Să se determine toate perechile de numere naturale nenule x, y (x<=y), cu proprietatea că x2+y2=k .
Variante Bacalaureat 2009
| Problema | x2y2k | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #62064482 | Utilizator | |
| Fișier | x2y2k.cpp | Dimensiune | 586 B |
| Data încărcării | 06 Ianuarie 2026, 16:49 | Scor/rezultat | 0 puncte |
x2y2k.cpp: In function 'bool este_patrat(int)': x2y2k.cpp:9:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=1; i*i<k; i++){ ^ x2y2k.cpp:10:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(nr == pp[i]){ ^ x2y2k.cpp: In function 'int main()': x2y2k.cpp:20:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i=1; i*i<k; i++) { ^ x2y2k.cpp:24:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i=1; i*i<k; i++) { ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | Depășit | Limita de timp depășită | 20 | 0 | ||
| 3 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
| 4 | 0.004 secunde | Caught fatal signal 11 | 20 | 0 | ||
| 5 | Depășit | Limita de timp depășită | 20 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema x2y2k 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ă.