#2857
LOL
În jocul League of Legends participă două echipe a câte 5
jucători notați a,b,c,d,e
, respectiv A,B,C,D,E
. Fiecare jucător are o valoare, inițial 300
, și un câștig, inițial 0
. În joc au loc lupte între perechi de jucători din echipe diferite, în urma fiecărei lupte fiind un învingător și un învins.
După luptă, câștigul învingătorului crește cu valoarea învinsului, valoarea sa crește cu 50
de bani, fără să depășească 1000
de bani, iar valoarea învinsului scade cu 50
de bani, neputând deveni mai mică decât 0
.
Dându-se lista luptelor, să se determine câți bani va avea fiecare jucător la finalul meciului.
Problema | LOL | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 32 MB
/
Stivă 8 MB
|
Id soluție | #51605943 | Utilizator | |
Fișier | lol.cpp | Dimensiune | 1.34 KB |
Data încărcării | 19 Iulie 2024, 18:33 | Scor / rezultat | Eroare de compilare |
lol.cpp: In function 'int main()': lol.cpp:25:56: error: no matching function for call to 'min(long long int, int)' ech1[poz1].val = min(ech1[poz1].val+50,1000); ^ lol.cpp:25:56: 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 lol.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: lol.cpp:25:56: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') ech1[poz1].val = min(ech1[poz1].val+50,1000); ^ 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 lol.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: lol.cpp:25:56: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') ech1[poz1].val = min(ech1[poz1].val+50,1000); ^ lol.cpp:26:53: error: no matching function for call to 'max(long long int, int)' ech2[poz2].val = max(ech2[poz2].val-50,0); ^ lol.cpp:26:53: 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 lol.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: lol.cpp:26:53: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') ech2[poz2].val = max(ech2[poz2].val-50,0); ^ 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 lol.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: lol.cpp:26:53: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') ech2[poz2].val = max(ech2[poz2].val-50,0); ^ lol.cpp:35:56: error: no matching function for call to 'min(long long int, int)' ech1[poz2].val = min(ech1[poz2].val-50,1000); ^ lol.cpp:35:56: 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 lol.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: lol.cpp:35:56: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') ech1[poz2].val = min(ech1[poz2].val-50,1000); ^ 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 lol.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: lol.cpp:35:56: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') ech1[poz2].val = min(ech1[poz2].val-50,1000); ^ lol.cpp:36:53: error: no matching function for call to 'max(long long int, int)' ech2[poz1].val = max(ech2[poz1].val+50,0); ^ lol.cpp:36:53: 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 lol.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: lol.cpp:36:53: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') ech2[poz1].val = max(ech2[poz1].val+50,0); ^ 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 lol.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: lol.cpp:36:53: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') ech2[poz1].val = max(ech2[poz1].val+50,0); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LOL 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ă.