#3316
Eratostene5
Se dau n
numere naturale nenule şi se notează cu P
produsul acestora. Să se afle numerele prime din descompunerea lui P
în factori primi, precum şi exponentul acestora.
NeuroN
Problema | Eratostene5 | Operații I/O |
eratostene5.in /eratostene5.out
|
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50404036 | Utilizator | |
Fișier | eratostene5.cpp | Dimensiune | 973 B |
Data încărcării | 08 Aprilie 2024, 13:44 | Scor / rezultat | Eroare de compilare |
eratostene5.cpp:5:25: error: conflicting declaration 'int f [1000001]' int e[1000001],f[1000001],p[500001],P; ^ eratostene5.cpp:3:10: error: 'f' has a previous declaration as 'std::ifstream f' ifstream f("eratostene5.in"); ^ eratostene5.cpp: In function 'void eratostene()': eratostene5.cpp:9:26: error: 'ij' was not declared in this scope for(int j=i*i;ij<=1000000;j+=i) ^ eratostene5.cpp: In function 'void desc(int)': eratostene5.cpp:20:22: error: lvalue required as increment operand n/=p[d];p++; ^ eratostene5.cpp:21:10: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[p[d]]+=pi; ^ eratostene5.cpp:24:12: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') { f[n]++; ^ eratostene5.cpp: In function 'int main()': eratostene5.cpp:39:16: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') if(f[i]) ^ eratostene5.cpp:40:24: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') g<<i<<' '<<f[i]<<'\n'; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Eratostene5 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ă.