#3324
Eratostene0
Vi se dau n
perechi de numere naturale i j
, cu i ≤ j
. Pentru fiecare pereche trebuie să aflați suma divizorilor tuturor numerelor din șirul i, i + 1, ..., j
.
Folclorul informatic
Problema | Eratostene0 | Operații I/O |
![]() eratostene0.in /eratostene0.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58104404 | Utilizator | |
Fișier | eratostene0.cpp | Dimensiune | 833 B |
Data încărcării | 14 Mai 2025, 11:55 | Scor / rezultat | Eroare de compilare |
eratostene0.cpp:4:24: error: uninitialized const 'e' [-fpermissive] const int MAX=1000000, e[MAX], s[MAX], d[MAX]; ^ eratostene0.cpp:4:32: error: uninitialized const 's' [-fpermissive] const int MAX=1000000, e[MAX], s[MAX], d[MAX]; ^ eratostene0.cpp:4:40: error: uninitialized const 'd' [-fpermissive] const int MAX=1000000, e[MAX], s[MAX], d[MAX]; ^ eratostene0.cpp: In function 'void ciur()': eratostene0.cpp:7:10: error: assignment of read-only location 'e[1]' e[1]=1; ^ eratostene0.cpp:10:29: error: 'MAx' was not declared in this scope for(int j=i;j<=MAx;j+=i) ^ eratostene0.cpp:12:26: warning: statement has no effect [-Wunused-value] e[j]==i; ^ eratostene0.cpp: In function 'void divizor()': eratostene0.cpp:20:14: error: 'p' was not declared in this scope p=e[aux]; ^ eratostene0.cpp: In function 'void sume()': eratostene0.cpp:29:10: error: assignment of read-only location 's[1]' s[1]=d[1]; ^ eratostene0.cpp:31:14: error: assignment of read-only location 's[i]' s[i]=s[i-1]+d[i]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Eratostene0 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ă.