#2041
camelot
Pe o matrice de dimensiune m
linii și n
coloane se cunosc coordonatele castelului și a k
cavaleri. Se cere să se determine:
1. numărul minim de mutări după care va ajunge la castel unul dintre cavaleri
2. numărul minim de mutări după care toţi cavalerii se vor afla la castel.
OLI 2017 judetul CLUJ
Problema | camelot | Operații I/O |
camelot.in /camelot.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 10 MB
/
Stivă 1 MB
|
Id soluție | #54064004 | Utilizator | |
Fișier | camelot.cpp | Dimensiune | 1.88 KB |
Data încărcării | 19 Noiembrie 2024, 08:08 | Scor / rezultat | Eroare de compilare |
camelot.cpp: In function 'int main()': camelot.cpp:63:45: error: no matching function for call to 'min(short unsigned int&, unsigned int&)' minim = min(minim, mat[x][y]); ^ camelot.cpp:63:45: 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 camelot.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: camelot.cpp:63:45: note: deduced conflicting types for parameter 'const _Tp' ('short unsigned int' and 'unsigned int') minim = min(minim, mat[x][y]); ^ 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 camelot.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: camelot.cpp:63:45: note: deduced conflicting types for parameter 'const _Tp' ('short unsigned int' and 'unsigned int') minim = min(minim, mat[x][y]); ^ camelot.cpp:75:45: error: no matching function for call to 'max(short unsigned int&, unsigned int&)' maxim = max(maxim, mat[x][y]); ^ camelot.cpp:75:45: 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 camelot.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: camelot.cpp:75:45: note: deduced conflicting types for parameter 'const _Tp' ('short unsigned int' and 'unsigned int') maxim = max(maxim, mat[x][y]); ^ 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 camelot.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: camelot.cpp:75:45: note: deduced conflicting types for parameter 'const _Tp' ('short unsigned int' and 'unsigned int') maxim = max(maxim, mat[x][y]); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema camelot 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ă.