#2141
exp
Se dă un şir de n
numere naturale nenule x1
, x2
, …, xn
şi un număr natural m
. Să se verifice dacă valoarea expresiei \( \sqrt[m]{ x_1 \cdot x_2 \cdot … \cdot x_n } \) este un număr natural. În caz afirmativ să se afișeze acest număr descompus în factori primi.
OJI 2004
Problema | exp | Operații I/O |
exp.in /exp.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49797400 | Utilizator | |
Fișier | exp.cpp | Dimensiune | 1.29 KB |
Data încărcării | 15 Martie 2024, 09:36 | Scor / rezultat | Eroare de compilare |
exp.cpp:9:53: error: 'int fmax' redeclared as different kind of symbol int n, m, x, F[1000], p = 1, E[30001], P[1000], np, fmax; ^ In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iosfwd:38, from /usr/include/c++/4.8/ios:38, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from exp.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:340:1: error: previous declaration of 'double fmax(double, double)' __MATHCALLX (fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); ^ exp.cpp: In function 'int main()': exp.cpp:36:27: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>' if(P[i] > fmax) fmax = P[i]; ^ exp.cpp:36:38: error: overloaded function with no contextual type information if(P[i] > fmax) fmax = P[i]; ^ exp.cpp:41:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>' if(x > fmax) fmax = x; ^ exp.cpp:41:35: error: overloaded function with no contextual type information if(x > fmax) fmax = x; ^ exp.cpp:47:25: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<=' for(int i = 2; i <= fmax && p == 1; i++) ^ exp.cpp:52:29: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<=' for(int i = 2; i <= fmax; i++) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema exp 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ă.