#4138
proeminenta
Cea mai cunoscută măsură a unui vârf de munte este altitudinea sa. Vârfuri secundare ale unui munte înalt pot avea altitudini considerabile, dar în general acestea nu sunt atât de relevante. Din acest motiv, geografii au introdus o nouă măsură pentru un vârf: proeminenţa. Un profil este o reprezentare a altitudinilor în puncte succesive, între care ne putem deplasa la stânga sau dreapta. Scrieţi un program care, cunoscând configuraţia unui profil, rezolvă următoarele două cerinţe:
1) determină numărul de vârfuri existente pe profilul respectiv;
2) determină proeminenţa fiecărui vârf de pe profil.
Problema | proeminenta | Operații I/O |
proeminenta.in /proeminenta.out
|
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52291399 | Utilizator | |
Fișier | proeminenta.cpp | Dimensiune | 1.35 KB |
Data încărcării | 25 Septembrie 2024, 17:08 | Scor / rezultat | Eroare de compilare |
proeminenta.cpp: In function 'int main()': proeminenta.cpp:37:44: error: no matching function for call to 'min(int&, long long int&)' else min1=min(min1,v[y].first); ^ proeminenta.cpp:37:44: 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 proeminenta.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: proeminenta.cpp:37:44: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') else min1=min(min1,v[y].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 proeminenta.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: proeminenta.cpp:37:44: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') else min1=min(min1,v[y].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 proeminenta.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: proeminenta.cpp:37:44: note: mismatched types 'std::initializer_list<_Tp>' and 'int' else min1=min(min1,v[y].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 proeminenta.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: proeminenta.cpp:37:44: note: mismatched types 'std::initializer_list<_Tp>' and 'int' else min1=min(min1,v[y].first); ^ proeminenta.cpp:45:42: error: no matching function for call to 'min(int&, long long int&)' else min2=min(min2,v[y].first); ^ proeminenta.cpp:45:42: 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 proeminenta.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: proeminenta.cpp:45:42: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') else min2=min(min2,v[y].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 proeminenta.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: proeminenta.cpp:45:42: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') else min2=min(min2,v[y].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 proeminenta.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: proeminenta.cpp:45:42: note: mismatched types 'std::initializer_list<_Tp>' and 'int' else min2=min(min2,v[y].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 proeminenta.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: proeminenta.cpp:45:42: note: mismatched types 'std::initializer_list<_Tp>' and 'int' else min2=min(min2,v[y].first); ^ proeminenta.cpp:8:18: warning: unused variable 'i' [-Wunused-variable] int c,n,x,nr,i,j,min1,min2,y,n1; ^ proeminenta.cpp:8:20: warning: unused variable 'j' [-Wunused-variable] int c,n,x,nr,i,j,min1,min2,y,n1; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema proeminenta 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ă.