#837
Fill
Se dă o matrice cu n
linii și m
coloane și elemente 0
sau 1
, care reprezintă harta unei planete, în care 1
înseamnă uscat, iar 0
înseamnă apă. Două elemente 1
care se învecinează pe linie sau pe coloană (nu și pe diagonală) fac parte din același continent.
Să se determine câte continente sunt pe hartă.
Problema | Fill | Operații I/O |
fill.in /fill.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #47698273 | Utilizator | |
Fișier | fill.cpp | Dimensiune | 723 B |
Data încărcării | 25 Decembrie 2023, 17:41 | Scor / rezultat | Eroare de compilare |
fill.cpp: In function 'void fill(int, int, int, int)': fill.cpp:9:33: error: no matching function for call to 'fill(int, int&)' if(A[i+1][j]==1) fill(i+1, j); ^ fill.cpp:9:33: note: candidates are: fill.cpp:7:6: note: void fill(int, int, int, int) void fill(int i, int j, int n, int m){ ^ fill.cpp:7:6: note: candidate expects 4 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from fill.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: fill.cpp:9:33: note: candidate expects 3 arguments, 2 provided if(A[i+1][j]==1) fill(i+1, j); ^ fill.cpp:10:33: error: no matching function for call to 'fill(int, int&)' if(A[i-1][j]==1) fill(i-1, j); ^ fill.cpp:10:33: note: candidates are: fill.cpp:7:6: note: void fill(int, int, int, int) void fill(int i, int j, int n, int m){ ^ fill.cpp:7:6: note: candidate expects 4 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from fill.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: fill.cpp:10:33: note: candidate expects 3 arguments, 2 provided if(A[i-1][j]==1) fill(i-1, j); ^ fill.cpp:11:33: error: no matching function for call to 'fill(int&, int)' if(A[i][j+1]==1) fill(i, j+1); ^ fill.cpp:11:33: note: candidates are: fill.cpp:7:6: note: void fill(int, int, int, int) void fill(int i, int j, int n, int m){ ^ fill.cpp:7:6: note: candidate expects 4 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from fill.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: fill.cpp:11:33: note: candidate expects 3 arguments, 2 provided if(A[i][j+1]==1) fill(i, j+1); ^ fill.cpp:12:33: error: no matching function for call to 'fill(int&, int)' if(A[i][j-1]==1) fill(i, j-1); ^ fill.cpp:12:33: note: candidates are: fill.cpp:7:6: note: void fill(int, int, int, int) void fill(int i, int j, int n, int m){ ^ fill.cpp:7:6: note: candidate expects 4 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from fill.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: fill.cpp:12:33: note: candidate expects 3 arguments, 2 provided if(A[i][j-1]==1) fill(i, j-1); ^ fill.cpp: In function 'int main()': fill.cpp:23:25: error: no matching function for call to 'fill(int&, int&)' fill(i,j); ^ fill.cpp:23:25: note: candidates are: fill.cpp:7:6: note: void fill(int, int, int, int) void fill(int i, int j, int n, int m){ ^ fill.cpp:7:6: note: candidate expects 4 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from fill.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: fill.cpp:23:25: note: candidate expects 3 arguments, 2 provided fill(i,j); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Fill 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ă.