#4871
Se dă un șir de n numere naturale. Pentru fiecare din numerele din șir trebuie să afișați următorul număr natural, strict mai mare, care este prim.
| Problema | NextPrime | Operații I/O |
nextprime.in/nextprime.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #62395876 | Utilizator | |
| Fișier | nextprime.cpp | Dimensiune | 2.19 KB |
| Data încărcării | 20 Ianuarie 2026, 11:50 | Scor/rezultat | 60 puncte |
nextprime.cpp: In function 'long long unsigned int NextPrime(long long unsigned int)': nextprime.cpp:37:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(prime.at(mij) == n){ ^ nextprime.cpp:43:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] else if(prime.at(mij) < n){ ^ nextprime.cpp:47:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(prime.at(mij+1)>n){ ^ nextprime.cpp:56:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(prime.at(mij-1)<=n) ^ nextprime.cpp:83:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0.008 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 1 | 0.016 secunde | OK. | 5 | 5 | ||
| 2 | 0.016 secunde | Raspuns gresit. | 5 | 0 | ||
| 3 | 0.012 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 4 | 0.008 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 5 | 0.032 secunde | Raspuns gresit. | 5 | 0 | ||
| 6 | 0.04 secunde | Raspuns gresit. | 5 | 0 | ||
| 7 | 0.056 secunde | Raspuns gresit. | 5 | 0 | ||
| 8 | 0.06 secunde | Raspuns gresit. | 5 | 0 | ||
| 9 | 0.06 secunde | OK. | 5 | 5 | ||
| 10 | 0.06 secunde | OK. | 5 | 5 | ||
| 11 | 0.064 secunde | OK. | 5 | 5 | ||
| 12 | 0.06 secunde | OK. | 10 | 10 | ||
| 13 | 0.064 secunde | OK. | 10 | 10 | ||
| 14 | 0.06 secunde | OK. | 10 | 10 | ||
| 15 | 0.06 secunde | OK. | 10 | 10 | ||
| Punctaj total | 60 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NextPrime 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ă.