#1149
Se dă un şir cu n elemente, numere naturale. Folosind metoda Divide et Impera să se verifice dacă în șir există elemente prime.
| Problema | ExistaPrimeDivImp | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64746769 | Utilizator | |
| Fișier | existaprimedivimp.cpp | Dimensiune | 434 B |
| Data încărcării | 27 Mai 2026, 14:30 | Scor/rezultat | 0 puncte |
existaprimedivimp.cpp: In function ‘int divimp(int, int)’: existaprimedivimp.cpp:17:6: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 17 | if(s==d) | ^~ existaprimedivimp.cpp:19:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 19 | int m=(s+d)/2; | ^~~ existaprimedivimp.cpp:20:11: warning: unused variable ‘a’ [-Wunused-variable] 20 | int a =divimp(s,m); | ^ existaprimedivimp.cpp:21:10: warning: unused variable ‘b’ [-Wunused-variable] 21 | int b= divimp(m+1,d); | ^ existaprimedivimp.cpp:21:19: warning: control reaches end of non-void function [-Wreturn-type] 21 | int b= divimp(m+1,d); | ~~~~~~^~~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 30 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 30 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ExistaPrimeDivImp 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ă.