#180
sortMinMax
Să se ordoneze crescător elementele dintr-un şir dat cuprinse între elementul de valoare maximă şi cel de valoare minimă.
Problema | sortMinMax | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54786659 | Utilizator | |
Fișier | sortminmax.cpp | Dimensiune | 1.13 KB |
Data încărcării | 08 Decembrie 2024, 19:30 | Scor / rezultat | Eroare de compilare |
sortminmax.cpp: In function 'int main()': sortminmax.cpp:47:32: error: no matching function for call to 'minmax(int&, int [1001], int&, int&)' minmax(n, v, pozmin, pozmax); ^ sortminmax.cpp:47:32: note: candidates are: 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 sortminmax.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4039:5: note: template<class _Tp> std::pair<const _Tp&, const _Tp&> std::minmax(const _Tp&, const _Tp&) minmax(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algo.h:4039:5: note: template argument deduction/substitution failed: sortminmax.cpp:47:32: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'int [1001]') minmax(n, v, pozmin, pozmax); ^ 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 sortminmax.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4059:5: note: template<class _Tp, class _Compare> std::pair<const _Tp&, const _Tp&> std::minmax(const _Tp&, const _Tp&, _Compare) minmax(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algo.h:4059:5: note: template argument deduction/substitution failed: sortminmax.cpp:47:32: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'int [1001]') minmax(n, v, pozmin, pozmax); ^ 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 sortminmax.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4241:5: note: template<class _Tp> std::pair<_FIter, _FIter> std::minmax(std::initializer_list<_Tp>) minmax(initializer_list<_Tp> __l) ^ /usr/include/c++/4.8/bits/stl_algo.h:4241:5: note: template argument deduction/substitution failed: sortminmax.cpp:47:32: note: mismatched types 'std::initializer_list<_Tp>' and 'int' minmax(n, v, pozmin, pozmax); ^ 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 sortminmax.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4250:5: note: template<class _Tp, class _Compare> std::pair<_FIter, _FIter> std::minmax(std::initializer_list<_Tp>, _Compare) minmax(initializer_list<_Tp> __l, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algo.h:4250:5: note: template argument deduction/substitution failed: sortminmax.cpp:47:32: note: mismatched types 'std::initializer_list<_Tp>' and 'int' minmax(n, v, pozmin, pozmax); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sortMinMax 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ă.