#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 | #53460999 | Utilizator | |
Fișier | dodel.cpp | Dimensiune | 685 B |
Data încărcării | 31 Octombrie 2024, 21:03 | Scor / rezultat | Eroare de compilare |
dodel.cpp: In function 'int main()': dodel.cpp:21:39: error: no matching function for call to 'max(long long int&, int&)' maxx=max(maxx, a[i][j]); ^ dodel.cpp:21:39: 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:21:39: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') maxx=max(maxx, a[i][j]); ^ 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:21:39: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') maxx=max(maxx, a[i][j]); ^ dodel.cpp:22:39: error: no matching function for call to 'min(long long int&, int&)' minn=min(minn, a[i][j]); ^ dodel.cpp:22:39: 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:22:39: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') minn=min(minn, a[i][j]); ^ 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:22:39: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') minn=min(minn, a[i][j]); ^ dodel.cpp:27:41: error: no matching function for call to 'max(long long int&, int&)' maxx2=max(maxx2, a[i][j]); ^ dodel.cpp:27:41: 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:27:41: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') maxx2=max(maxx2, a[i][j]); ^ 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:27:41: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') maxx2=max(maxx2, a[i][j]); ^ dodel.cpp:28:41: error: no matching function for call to 'min(long long int&, int&)' minn2=min(minn2, a[i][j]); ^ dodel.cpp:28:41: 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:28:41: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') minn2=min(minn2, a[i][j]); ^ 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:28:41: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') minn2=min(minn2, a[i][j]); ^
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ă.