Detalii evaluare #54643192

Rezumat problemă

#1369 Parcela

Se dau n și m reprezentând dimensiunile unui tablou bidimensional format din elementele 0 si 1. Se definește o parcelă ca fiind o grupare de elemente vecine cu valoarea 1. Să se determine numărul de parcele nr, aria maximă a unei parcele amax și respectiv numărul parcelei cu arie maximă pmax.

Detalii

Problema Parcela Operații I/O parcela.in/parcela.out
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #54643192 Utilizator Onita Mihai (Mihaii07)
Fișier parcela.cpp Dimensiune 912 B
Data încărcării 04 Decembrie 2024, 13:32 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

parcela.cpp:8:22: error: expected identifier before ')' token
 int fill(int i,int j,)

                      ^
parcela.cpp: In function 'int fill(int, int, int)':
parcela.cpp:12:49: error: no matching function for call to 'fill(int, int&)'
     if(i>1 && A[i-1][j]==1) aria=aria+fill(i-1,j);///N

                                                 ^
parcela.cpp:12:49: note: candidates are:
parcela.cpp:8:5: note: int fill(int, int, int)
 int fill(int i,int j,)

     ^
parcela.cpp:8:5: note:   candidate expects 3 arguments, 2 provided
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 parcela.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)
     fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:721:5: note:   template argument deduction/substitution failed:
parcela.cpp:12:49: note:   candidate expects 3 arguments, 2 provided
     if(i>1 && A[i-1][j]==1) aria=aria+fill(i-1,j);///N

                                                 ^
parcela.cpp:13:49: error: no matching function for call to 'fill(int&, int)'
     if(j<m && A[i][j+1]==1) aria=aria+fill(i,j+1);///E

                                                 ^
parcela.cpp:13:49: note: candidates are:
parcela.cpp:8:5: note: int fill(int, int, int)
 int fill(int i,int j,)

     ^
parcela.cpp:8:5: note:   candidate expects 3 arguments, 2 provided
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 parcela.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)
     fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:721:5: note:   template argument deduction/substitution failed:
parcela.cpp:13:49: note:   candidate expects 3 arguments, 2 provided
     if(j<m && A[i][j+1]==1) aria=aria+fill(i,j+1);///E

                                                 ^
parcela.cpp:14:49: error: no matching function for call to 'fill(int, int&)'
     if(i<n && A[i+1][j]==1) aria=aria+fill(i+1,j);///S

                                                 ^
parcela.cpp:14:49: note: candidates are:
parcela.cpp:8:5: note: int fill(int, int, int)
 int fill(int i,int j,)

     ^
parcela.cpp:8:5: note:   candidate expects 3 arguments, 2 provided
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 parcela.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)
     fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:721:5: note:   template argument deduction/substitution failed:
parcela.cpp:14:49: note:   candidate expects 3 arguments, 2 provided
     if(i<n && A[i+1][j]==1) aria=aria+fill(i+1,j);///S

                                                 ^
parcela.cpp:15:49: error: no matching function for call to 'fill(int&, int)'
     if(j>1 && A[i][j-1]==1) aria=aria+fill(i,j-1);///V

                                                 ^
parcela.cpp:15:49: note: candidates are:
parcela.cpp:8:5: note: int fill(int, int, int)
 int fill(int i,int j,)

     ^
parcela.cpp:8:5: note:   candidate expects 3 arguments, 2 provided
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 parcela.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)
     fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:721:5: note:   template argument deduction/substitution failed:
parcela.cpp:15:49: note:   candidate expects 3 arguments, 2 provided
     if(j>1 && A[i][j-1]==1) aria=aria+fill(i,j-1);///V

                                                 ^
parcela.cpp: In function 'int main()':
parcela.cpp:30:30: error: no matching function for call to 'fill(int&, int&)'
             int aria=fill(i,j);

                              ^
parcela.cpp:30:30: note: candidates are:
parcela.cpp:8:5: note: int fill(int, int, int)
 int fill(int i,int j,)

     ^
parcela.cpp:8:5: note:   candidate expects 3 arguments, 2 provided
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 parcela.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)
     fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:721:5: note:   template argument deduction/substitution failed:
parcela.cpp:30:30: note:   candidate expects 3 arguments, 2 provided
             int aria=fill(i,j);

                              ^

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