#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 | #61802165 | Utilizator | |
| Fișier | nextprime.cpp | Dimensiune | 1.20 KB |
| Data încărcării | 10 Decembrie 2025, 16:36 | Scor/rezultat | Eroare de compilare |
nextprime.cpp:4:14: error: expected type-specifier before '__uint128_t' using u128 = __uint128_t; ^ nextprime.cpp: In function 'u64 pw(u64, u64, u64)': nextprime.cpp:7:5: error: 'u128' was not declared in this scope u128 r = 1, x = a; ^ nextprime.cpp:7:10: error: expected ';' before 'r' u128 r = 1, x = a; ^ nextprime.cpp:9:17: error: 'r' was not declared in this scope if(d&1) r = r * x % m; ^ nextprime.cpp:9:25: error: 'x' was not declared in this scope if(d&1) r = r * x % m; ^ nextprime.cpp:10:9: error: 'x' was not declared in this scope x = x * x % m; ^ nextprime.cpp:13:17: error: 'r' was not declared in this scope return (u64)r; ^ nextprime.cpp: In function 'bool prime(u64)': nextprime.cpp:30:18: error: 'u128' was not declared in this scope x = (u128)x * x % n; ^ nextprime.cpp:30:23: error: expected ';' before 'x' x = (u128)x * x % n; ^ nextprime.cpp: In function 'u64 pw(u64, u64, u64)': nextprime.cpp:14:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.