#3312
Eratostene1
Se dau n
numere naturale. Aflaţi câte dintre aceste numere sunt prime.
NeuroN
Problema | Eratostene1 | Operații I/O |
![]() eratostene1.in /eratostene1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0.1 MB
|
Id soluție | #57891231 | Utilizator | |
Fișier | eratostene1.cpp | Dimensiune | 1.02 KB |
Data încărcării | 29 Aprilie 2025, 13:45 | Scor / rezultat | Eroare de compilare |
eratostene1.cpp:13:13: error: 'LIMIT' was not declared in this scope std::bitset<LIMIT> cache; ^ eratostene1.cpp:13:18: error: template argument 1 is invalid std::bitset<LIMIT> cache; ^ eratostene1.cpp:13:25: error: invalid type in declaration before ';' token std::bitset<LIMIT> cache; ^ eratostene1.cpp: In function 'void constructor()': eratostene1.cpp:18:10: error: invalid types 'int[int]' for array subscript cache[0] = cache[1] = true; ^ eratostene1.cpp:18:21: error: invalid types 'int[int]' for array subscript cache[0] = cache[1] = true; ^ eratostene1.cpp:19:20: error: 'LIMIT' was not declared in this scope int limit = sqrt(LIMIT); ^ eratostene1.cpp:19:25: error: 'sqrt' was not declared in this scope int limit = sqrt(LIMIT); ^ eratostene1.cpp:21:16: error: invalid types 'int[int]' for array subscript if (cache[i] == false) ^ eratostene1.cpp:23:16: error: invalid types 'int[int]' for array subscript cache[j] = true; ^ eratostene1.cpp:26:16: error: invalid types 'int[int]' for array subscript if (cache[i] == false) ^ eratostene1.cpp: In function 'int main()': eratostene1.cpp:50:22: error: 'prim' was not declared in this scope cnt += prim(x); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Eratostene1 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ă.