#1864
Moș Crăciun locuiește la polul nord și pregătește cadouri pentru copii cuminți din clasele a X-a B și A, ajutat de mai mulți spiriduși. Datorită încălzirii globale, gheața se topește, formându-se mai multe banchize. Spiridușii care se află pe alte banchize decât Moș Crăciun nu-l mai pot ajuta pe acesta, spre disperarea generală.
Scrieți un program care să determine câți spiriduși se află pe aceeași banchiză cu Moș Crăciun și îl pot ajuta în continuare să pregătească cadouri pentru copii cuminți din clasele a X-a B și A.
| Problema | MosCraciun | Operații I/O |
moscraciun.in/moscraciun.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63040065 | Utilizator | |
| Fișier | moscraciun.cpp | Dimensiune | 772 B |
| Data încărcării | 11 Februarie 2026, 12:53 | Scor/rezultat | Eroare de compilare |
moscraciun.cpp: In function 'int fill(int, int, int&)': moscraciun.cpp:12:38: error: no matching function for call to 'fill(int, int&, int&, int&)' if(a[x-1][y]!=0) fill(x-1,y, b, r); ^ moscraciun.cpp:12:38: note: candidates are: moscraciun.cpp:7:5: note: int fill(int, int, int&) int fill(int x, int y, int &b) ^ moscraciun.cpp:7:5: note: candidate expects 3 arguments, 4 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 moscraciun.cpp:2: /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: moscraciun.cpp:12:38: note: candidate expects 3 arguments, 4 provided if(a[x-1][y]!=0) fill(x-1,y, b, r); ^ moscraciun.cpp:13:38: error: no matching function for call to 'fill(int&, int, int&, int&)' if(a[x][y+1]!=0) fill(x,y+1, b, r); ^ moscraciun.cpp:13:38: note: candidates are: moscraciun.cpp:7:5: note: int fill(int, int, int&) int fill(int x, int y, int &b) ^ moscraciun.cpp:7:5: note: candidate expects 3 arguments, 4 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 moscraciun.cpp:2: /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: moscraciun.cpp:13:38: note: candidate expects 3 arguments, 4 provided if(a[x][y+1]!=0) fill(x,y+1, b, r); ^ moscraciun.cpp:14:38: error: no matching function for call to 'fill(int, int&, int&, int&)' if(a[x+1][y]!=0) fill(x+1,y, b, r); ^ moscraciun.cpp:14:38: note: candidates are: moscraciun.cpp:7:5: note: int fill(int, int, int&) int fill(int x, int y, int &b) ^ moscraciun.cpp:7:5: note: candidate expects 3 arguments, 4 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 moscraciun.cpp:2: /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: moscraciun.cpp:14:38: note: candidate expects 3 arguments, 4 provided if(a[x+1][y]!=0) fill(x+1,y, b, r); ^ moscraciun.cpp:15:38: error: no matching function for call to 'fill(int&, int, int&, int&)' if(a[x][y-1]!=0) fill(x,y-1, b, r); ^ moscraciun.cpp:15:38: note: candidates are: moscraciun.cpp:7:5: note: int fill(int, int, int&) int fill(int x, int y, int &b) ^ moscraciun.cpp:7:5: note: candidate expects 3 arguments, 4 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 moscraciun.cpp:2: /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: moscraciun.cpp:15:38: note: candidate expects 3 arguments, 4 provided if(a[x][y-1]!=0) fill(x,y-1, b, r); ^ moscraciun.cpp:16:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MosCraciun 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ă.