#3313
Se dau n numere naturale. Aflaţi pentru fiecare număr câţi factori primi are în descompunere.
NeuroN
| Problema | Eratostene2 | Operații I/O |
eratostene2.in/eratostene2.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #65012398 | Utilizator | |
| Fișier | eratostene2.cpp | Dimensiune | 446 B |
| Data încărcării | 14 Iulie 2026, 12:44 | Scor/rezultat | 100 puncte |
eratostene2.cpp: In function ‘int main()’: eratostene2.cpp:11:13: warning: iteration 1000000 invokes undefined behavior [-Waggressive-loop-optimizations] 11 | P[i]=0; | ~~~~^~ eratostene2.cpp:10:18: note: within this loop 10 | for(int i=1;i<=n;i++) | ~^~~ eratostene2.cpp:13:15: warning: iteration 999999 invokes undefined behavior [-Waggressive-loop-optimizations] 13 | if(P[i]==0) | ~~~^ eratostene2.cpp:12:18: note: within this loop 12 | for(int i=2;i<=n;i++) | ~^~~ eratostene2.cpp:11:13: warning: ‘void* __builtin_memset(void*, int, long unsigned int)’ forming offset [4000004, 4000007] is out of the bounds [0, 4000004] of object ‘P’ with type ‘int [1000001]’ [-Warray-bounds=] 11 | P[i]=0; | ~~~~^~ eratostene2.cpp:6:7: note: ‘P’ declared here 6 | int n,P[1000001]; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.009 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.009 secunde | OK. | 20 | 20 | ||
| 3 | 0.026 secunde | OK. | 20 | 20 | ||
| 4 | 0.039 secunde | OK. | 20 | 20 | ||
| 5 | 0.071 secunde | OK. | 20 | 20 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Eratostene2 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ă.