#2779
cntSQ
Se dă o matrice binară (valori 0
și 1
). Să se determine câte pătrate exista cu proprietatea că acestea au pe marginea lor doar valori 1
.
Problema | cntSQ | Operații I/O |
cntsq.in /cntsq.out
|
---|---|---|---|
Limita timp | 0.15 secunde | Limita memorie |
Total: 32 MB
/
Stivă 8 MB
|
Id soluție | #48789128 | Utilizator | |
Fișier | cntsq.cpp | Dimensiune | 3.49 KB |
Data încărcării | 05 Februarie 2024, 18:04 | Scor / rezultat | Eroare de compilare |
cntsq.cpp: In function 'int main()': cntsq.cpp:115:34: error: no matching function for call to 'min(int, short int&)' for (j = min(n + 1 - i, m); j >= 1; j--) ^ cntsq.cpp:115:34: 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/fstream:38, from cntsq.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: cntsq.cpp:115:34: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'short int') for (j = min(n + 1 - i, m); j >= 1; 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/istream:38, from /usr/include/c++/4.8/fstream:38, from cntsq.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: cntsq.cpp:115:34: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'short int') for (j = min(n + 1 - i, m); j >= 1; j--) ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from cntsq.cpp:3: /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: cntsq.cpp:115:34: note: mismatched types 'std::initializer_list<_Tp>' and 'int' for (j = min(n + 1 - i, m); j >= 1; j--) ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from cntsq.cpp:3: /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: cntsq.cpp:115:34: note: mismatched types 'std::initializer_list<_Tp>' and 'int' for (j = min(n + 1 - i, m); j >= 1; j--) ^ cntsq.cpp:136:34: error: no matching function for call to 'min(int, short int&)' for (i = min(m + 1 - j, n); i >= 1; i--) ^ cntsq.cpp:136:34: 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/fstream:38, from cntsq.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: cntsq.cpp:136:34: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'short int') for (i = min(m + 1 - j, n); i >= 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/istream:38, from /usr/include/c++/4.8/fstream:38, from cntsq.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: cntsq.cpp:136:34: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'short int') for (i = min(m + 1 - j, n); i >= 1; i--) ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from cntsq.cpp:3: /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: cntsq.cpp:136:34: note: mismatched types 'std::initializer_list<_Tp>' and 'int' for (i = min(m + 1 - j, n); i >= 1; i--) ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from cntsq.cpp:3: /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: cntsq.cpp:136:34: note: mismatched types 'std::initializer_list<_Tp>' and 'int' for (i = min(m + 1 - j, n); i >= 1; i--) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cntSQ 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ă.