#837
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 | #64567115 | Utilizator | |
| Fișier | fill.cpp | Dimensiune | 487 B |
| Data încărcării | 14 Mai 2026, 17:34 | Scor/rezultat | Eroare de compilare |
fill.cpp: In function ‘void fill(int, int, int (*)[102])’: fill.cpp:11:9: error: no matching function for call to ‘fill(int, int&)’ 11 | fill(i-1,j); | ~~~~^~~~~~~ In file included from /usr/include/c++/13/string:51, from /usr/include/c++/13/bits/locale_classes.h:40, from /usr/include/c++/13/bits/ios_base.h:41, from /usr/include/c++/13/ios:44, from /usr/include/c++/13/ostream:40, from /usr/include/c++/13/iostream:41, from fill.cpp:1: /usr/include/c++/13/bits/stl_algobase.h:1000:5: note: candidate: ‘template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)’ 1000 | fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) | ^~~~ /usr/include/c++/13/bits/stl_algobase.h:1000:5: note: template argument deduction/substitution failed: fill.cpp:11:9: note: candidate expects 3 arguments, 2 provided 11 | fill(i-1,j); | ~~~~^~~~~~~ fill.cpp:7:6: note: candidate: ‘void fill(int, int, int (*)[102])’ 7 | void fill(int i,int j,int a[][102]) | ^~~~ fill.cpp:7:6: note: candidate expects 3 arguments, 2 provided fill.cpp:12:10: error: no matching function for call to ‘fill(int, int&)’ 12 | fill(i+1,j); | ~~~~^~~~~~~ /usr/include/c++/13/bits/stl_algobase.h:1000:5: note: candidate: ‘template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)’ 1000 | fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) | ^~~~ /usr/include/c++/13/bits/stl_algobase.h:1000:5: note: template argument deduction/substitution failed: fill.cpp:12:10: note: candidate expects 3 arguments, 2 provided 12 | fill(i+1,j); | ~~~~^~~~~~~ fill.cpp:7:6: note: candidate: ‘void fill(int, int, int (*)[102])’ 7 | void fill(int i,int j,int a[][102]) | ^~~~ fill.cpp:7:6: note: candidate expects 3 arguments, 2 provided fill.cpp:13:11: error: no matching function for call to ‘fill(int&, int)’ 13 | fill(i,j-1); | ~~~~^~~~~~~ /usr/include/c++/13/bits/stl_algobase.h:1000:5: note: candidate: ‘template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)’ 1000 | fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) | ^~~~ /usr/include/c++/13/bits/stl_algobase.h:1000:5: note: template argument deduction/substitution failed: fill.cpp:13:11: note: candidate expects 3 arguments, 2 provided 13 | fill(i,j-1); | ~~~~^~~~~~~ fill.cpp:7:6: note: candidate: ‘void fill(int, int, int (*)[102])’ 7 | void fill(int i,int j,int a[][102]) | ^~~~ fill.cpp:7:6: note: candidate expects 3 arguments, 2 provided fill.cpp:14:12: error: no matching function for call to ‘fill(int&, int)’ 14 | fill(i,j+1); | ~~~~^~~~~~~ /usr/include/c++/13/bits/stl_algobase.h:1000:5: note: candidate: ‘template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)’ 1000 | fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) | ^~~~ /usr/include/c++/13/bits/stl_algobase.h:1000:5: note: template argument deduction/substitution failed: fill.cpp:14:12: note: candidate expects 3 arguments, 2 provided 14 | fill(i,j+1); | ~~~~^~~~~~~ fill.cpp:7:6: note: candidate: ‘void fill(int, int, int (*)[102])’ 7 | void fill(int i,int j,int a[][102]) | ^~~~ fill.cpp:7:6: note: candidate expects 3 arguments, 2 provided fill.cpp: In function ‘int main()’: fill.cpp:24:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 24 | if(a[i][j]=1) | ~~~~~~~^~ fill.cpp:27:9: error: no matching function for call to ‘fill(int&, int&)’ 27 | fill(i,j); | ~~~~^~~~~ /usr/include/c++/13/bits/stl_algobase.h:1000:5: note: candidate: ‘template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)’ 1000 | fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) | ^~~~ /usr/include/c++/13/bits/stl_algobase.h:1000:5: note: template argument deduction/substitution failed: fill.cpp:27:9: note: candidate expects 3 arguments, 2 provided 27 | fill(i,j); | ~~~~^~~~~ fill.cpp:7:6: note: candidate: ‘void fill(int, int, int (*)[102])’ 7 | void fill(int i,int j,int a[][102]) | ^~~~ fill.cpp:7:6: note: candidate expects 3 arguments, 2 provided
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ă.