#4578
Dodel
Dodel manelistul a fost surprins de către domnul profesor de informatică în timp ce asculta manele la căști în timpul orei de informatică. Domnul profesor îi dă să rezolve o problemă de informatică, iar dacă nu reușește până la finalul orei, Dodel va fi pedepsit să asculte muzică rock până la finalul anului școlar. Disperat de această perspectivă sumbră, Dodel vă roagă sa îl ajutați să rezolve problema de informatică primită.
Se dă o matrice cu n
linii şi n
coloane şi elemente numere întregi. Calculaţi cel mai mare produs care se poate obține prin înmulțirea unui element de pe diagonala principală cu unul de pe diagonala secundară.
Problema | Dodel | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53997584 | Utilizator | |
Fișier | dodel.cpp | Dimensiune | 481 B |
Data încărcării | 17 Noiembrie 2024, 13:36 | Scor / rezultat | Eroare de compilare |
dodel.cpp: In function 'int main()': dodel.cpp:12:24: error: no matching function for call to 'max(long long int&, int&)' max1=max(max1,v[i][i]); ^ dodel.cpp:12:24: 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 dodel.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: dodel.cpp:12:24: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') max1=max(max1,v[i][i]); ^ 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 dodel.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: dodel.cpp:12:24: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') max1=max(max1,v[i][i]); ^ dodel.cpp:13:28: error: no matching function for call to 'max(long long int&, int&)' max2=max(max2,v[i][n-1-i]); ^ dodel.cpp:13:28: 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 dodel.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: dodel.cpp:13:28: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') max2=max(max2,v[i][n-1-i]); ^ 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 dodel.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: dodel.cpp:13:28: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') max2=max(max2,v[i][n-1-i]); ^ dodel.cpp:14:24: error: no matching function for call to 'min(long long int&, int&)' min1=min(min1,v[i][i]); ^ dodel.cpp:14:24: 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 dodel.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: dodel.cpp:14:24: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') min1=min(min1,v[i][i]); ^ 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 dodel.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: dodel.cpp:14:24: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') min1=min(min1,v[i][i]); ^ dodel.cpp:15:28: error: no matching function for call to 'min(long long int&, int&)' min2=min(min2,v[i][n-1-i]); ^ dodel.cpp:15:28: 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 dodel.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: dodel.cpp:15:28: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') min2=min(min2,v[i][n-1-i]); ^ 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 dodel.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: dodel.cpp:15:28: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') min2=min(min2,v[i][n-1-i]); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Dodel 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ă.