#303
Se dau n numere naturale mai mici decât 1.000.000. Determinaţi câte dintre ele sunt prime.
| Problema | Eratostene | Operații I/O |
eratostene.in/eratostene.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63531153 | Utilizator | |
| Fișier | eratostene.cpp | Dimensiune | 1.12 KB |
| Data încărcării | 07 Martie 2026, 22:09 | Scor/rezultat | Eroare de compilare |
eratostene.cpp:9:11: error: 'array' in namespace 'std' does not name a type constexpr std::array<bool, PRIME_CHECK_CAP> compute_is_not_prime() { ^ eratostene.cpp: In function 'bool is_prime(int)': eratostene.cpp:28:15: error: 'runtime_error' is not a member of 'std' throw std::runtime_error("Number out of bounds for primality check"); ^ eratostene.cpp:31:22: error: 'array' in namespace 'std' does not name a type static constexpr std::array<bool, PRIME_CHECK_CAP> table = compute_is_not_prime<PRIME_CHECK_CAP>(); ^ eratostene.cpp:32:13: error: 'table' was not declared in this scope return !table[number]; ^ eratostene.cpp: In function 'bool is_prime(int) [with unsigned int PRIME_CHECK_CAP = 100u]': eratostene.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Eratostene 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ă.