#3057
Se dă un număr natural n
. Să se afișeze DA
dacă numărul este prim altfel se afișează NU
.
Problema | Rabin-Miller | Operații I/O |
![]() rabin-miller.in /rabin-miller.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 128 MB
/
Stivă 128 MB
|
Id soluție | #56402880 | Utilizator | |
Fișier | rabin-miller.cpp | Dimensiune | 1.57 KB |
Data încărcării | 17 Februarie 2025, 21:03 | Scor / rezultat | Eroare de compilare |
rabin-miller.cpp:19:7: error: invalid preprocessing directive #x # x - 1 = d*2^s ^ rabin-miller.cpp:22:23: error: stray '#' in program return False # divisible by 2! ^ rabin-miller.cpp:24:7: error: invalid preprocessing directive #As # As long as Riemann hypothesis holds true, it is impossible ^ rabin-miller.cpp:25:7: error: invalid preprocessing directive #that # that all the numbers below this threshold are strong liars. ^ rabin-miller.cpp:26:7: error: invalid preprocessing directive #Hence # Hence the number is guaranteed to be a prime if no contradiction is found. ^ rabin-miller.cpp:29:11: error: invalid preprocessing directive #From # From Fermat's little theorem if x is a prime then a^(x-1) % x == 1 ^ rabin-miller.cpp:29:22: warning: missing terminating ' character [enabled by default] # From Fermat's little theorem if x is a prime then a^(x-1) % x == 1 ^ rabin-miller.cpp:30:11: error: invalid preprocessing directive #Hence # Hence the below must hold true if x is indeed a prime: ^ rabin-miller.cpp:36:19: error: invalid preprocessing directive #Contradicts # Contradicts Fermat's little theorem, hence not a prime. ^ rabin-miller.cpp:36:37: warning: missing terminating ' character [enabled by default] # Contradicts Fermat's little theorem, hence not a prime. ^ rabin-miller.cpp:38:7: error: invalid preprocessing directive #No # No contradiction found, hence x must be a prime. ^ rabin-miller.cpp:1:1: error: 'f' does not name a type f=open("rabin-miller.in","r") ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Rabin-Miller 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ă.