#937
Hercule
Hercule trebuie sa strabată un labirint cu capcane reprezentat de o matrice cu n
linii și m
coloane. Pentru fiecare celula a labirintului, se cunoaște timpul exprimat în minute după care celula respectivă devine capcană. După ce o celula devine capcana, Hercule piere dacă intră în acea celulă.
Sa se afișeze numarul total de drumuri pe care le poate urma Hercule prin labirint, astfel încât Hercule să nu piară.
Problema | Hercule | Operații I/O |
hercule.in /hercule.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #36277582 | Utilizator | |
Fișier | hercule.cpp | Dimensiune | 706 B |
Data încărcării | 13 Aprilie 2022, 09:32 | Scor / rezultat | Eroare de compilare |
hercule.cpp: In function 'void back(int, int, int)': hercule.cpp:12:15: error: reference to 'max' is ambiguous if(vf>max) max=vf; ^ hercule.cpp:5:31: note: candidates are: int max int n,m,i,j,a[22][22],stx,sty,max=0,st[402][2]; ^ 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 hercule.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ hercule.cpp:12:20: error: reference to 'max' is ambiguous if(vf>max) max=vf; ^ hercule.cpp:5:31: note: candidates are: int max int n,m,i,j,a[22][22],stx,sty,max=0,st[402][2]; ^ 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 hercule.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ hercule.cpp:16:30: error: expected primary-expression before ',' token if(a[x-1][y]<a[x][y]), back(x-1,y,vf+1); ^ hercule.cpp:17:30: error: expected primary-expression before ',' token if(a[x+1][y]<a[x][y]), back(x+1,Y,vf+1); ^ hercule.cpp:17:41: error: 'Y' was not declared in this scope if(a[x+1][y]<a[x][y]), back(x+1,Y,vf+1); ^ hercule.cpp:18:30: error: expected primary-expression before ',' token if(a[x][y-1]<a[x][y]), back(x,y-1,vf+1); ^ hercule.cpp:19:30: error: expected primary-expression before ',' token if(a[x][y+1]<a[x][y]), back(x,y+1,vf+1); ^ hercule.cpp: In function 'int main()': hercule.cpp:26:13: error: expected ')' before ';' token for((j=1;j<=n;j++) ^ hercule.cpp:30:9: error: expected ';' before 'fout' fout<<vmax; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Hercule 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ă.