#1474
exponent
Dându-se două numere naturale n
şi a
, nenule, se cere să se determine exponentul numărului natural a
în descompunerea în factori primi a lui n!
.
Propunere OMI Iasi 2016 clasa a IX-a
Problema | exponent | Operații I/O |
exponent.in /exponent.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 3 MB
/
Stivă 1 MB
|
Id soluție | #54812269 | Utilizator | |
Fișier | exponent.cpp | Dimensiune | 1.28 KB |
Data încărcării | 09 Decembrie 2024, 13:33 | Scor / rezultat | Eroare de compilare |
exponent.cpp: In function 'int main()': exponent.cpp:57:36: error: 'INT_MAX' was not declared in this scope long long int exponent_total = INT_MAX; ^ exponent.cpp:65:71: error: no matching function for call to 'min(long long int&, int)' exponent_total = min(exponent_total, exp_factor / count_factor); ^ exponent.cpp:65:71: note: candidates are: In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from exponent.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template argument deduction/substitution failed: exponent.cpp:65:71: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') exponent_total = min(exponent_total, exp_factor / count_factor); ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from exponent.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template argument deduction/substitution failed: exponent.cpp:65:71: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') exponent_total = min(exponent_total, exp_factor / count_factor); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from exponent.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4221:5: note: template<class _Tp> _Tp std::min(std::initializer_list<_Tp>) min(initializer_list<_Tp> __l) ^ /usr/include/c++/4.8/bits/stl_algo.h:4221:5: note: template argument deduction/substitution failed: exponent.cpp:65:71: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' exponent_total = min(exponent_total, exp_factor / count_factor); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from exponent.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:4226:5: note: template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare) min(initializer_list<_Tp> __l, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algo.h:4226:5: note: template argument deduction/substitution failed: exponent.cpp:65:71: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' exponent_total = min(exponent_total, exp_factor / count_factor); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema exponent 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ă.