#2628
h2
În urma referendumului a rămas doar un șir de numere naturale a[1]
, a[2]
, …, a[n]
. Să se determine cel mai mic număr care apare exact o dată în șir.
Folclorul informatic
Problema | h2 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.9 secunde | Limita memorie |
Total: 128 MB
/
Stivă 8 MB
|
Id soluție | #53328333 | Utilizator | |
Fișier | h2.cpp | Dimensiune | 661 B |
Data încărcării | 24 Octombrie 2024, 16:16 | Scor / rezultat | Eroare de compilare |
h2.cpp: In function 'void rez()': h2.cpp:27:36: error: no matching function for call to 'min(int&, const unsigned int&)' ans = min(ans, i->first); ^ h2.cpp:27:36: 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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from h2.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: h2.cpp:27:36: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'unsigned int') ans = min(ans, i->first); ^ 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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from h2.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: h2.cpp:27:36: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'unsigned int') ans = min(ans, i->first); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from h2.cpp:1: /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: h2.cpp:27:36: note: mismatched types 'std::initializer_list<_Tp>' and 'int' ans = min(ans, i->first); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from h2.cpp:1: /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: h2.cpp:27:36: note: mismatched types 'std::initializer_list<_Tp>' and 'int' ans = min(ans, i->first); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema h2 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ă.