Detalii evaluare #48789128

Rezumat problemă

#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.

Detalii

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 Camburu Luca Stefan (Luca1208)
Fișier cntsq.cpp Dimensiune 3.49 KB
Data încărcării 05 Februarie 2024, 18:04 Scor / rezultat Eroare de compilare

Evaluare


Mesaj 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--)

                                  ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema cntSQ face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.