#2608
biprime
Se dă n
un număr natural care este produsul a două numere prime distincte, şi m
reprezentând numărul numerelor mai mici sau egale cu n
, prime cu n
. Aflaţi cele două numere prime din descompunerea lui n
.
Problema | biprime | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54399727 | Utilizator | |
Fișier | biprime.cpp | Dimensiune | 1.43 KB |
Data încărcării | 27 Noiembrie 2024, 16:37 | Scor / rezultat | Eroare de compilare |
biprime.cpp: In function 'std::pair<long long unsigned int, long long unsigned int> gasesteFactoriPrimi(long long unsigned int, long long unsigned int)': biprime.cpp:19:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (p1 != p2 && estePrim(p2)) { // Cei doi factori trebuie să fie primi și distincți ^ biprime.cpp:23:39: error: no matching function for call to 'min(long long unsigned int&, int&)' return {min(p1, p2), max(p1, p2)}; ^ biprime.cpp:23:39: 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 biprime.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: biprime.cpp:23:39: note: deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and 'int') return {min(p1, p2), max(p1, p2)}; ^ 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 biprime.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: biprime.cpp:23:39: note: deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and 'int') return {min(p1, p2), max(p1, p2)}; ^ biprime.cpp:23:52: error: no matching function for call to 'max(long long unsigned int&, int&)' return {min(p1, p2), max(p1, p2)}; ^ biprime.cpp:23:52: 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 biprime.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template argument deduction/substitution failed: biprime.cpp:23:52: note: deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and 'int') return {min(p1, p2), max(p1, p2)}; ^ 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 biprime.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template argument deduction/substitution failed: biprime.cpp:23:52: note: deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and 'int') return {min(p1, p2), max(p1, p2)}; ^ biprime.cpp:23:53: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::pair<long long unsigned int, long long unsigned int>' return {min(p1, p2), max(p1, p2)}; ^ biprime.cpp: In function 'int main()': biprime.cpp:39:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (factori.first != -1) { ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema biprime 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ă.