#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 | #36276879 | Utilizator | |
Fișier | hercule.cpp | Dimensiune | 609 B |
Data încărcării | 13 Aprilie 2022, 09:10 | Scor / rezultat | Eroare de compilare |
hercule.cpp:1:2: error: invalid preprocessing directive #< #<include<fstream> ^ hercule.cpp:3:1: error: 'ifstream' does not name a type ifstream fin("hercule.in"); ^ hercule.cpp:4:1: error: 'ofstream' does not name a type ofstream fout("hercule.out"); ^ hercule.cpp:5:22: error: expected initializer before '.' token int n,m,i,j,a[22][22].stx,sty,max=0,st[402][2]; ^ hercule.cpp: In function 'void back(int, int, int)': hercule.cpp:8:5: error: 'st' was not declared in this scope st[vf[0]]=x; ^ hercule.cpp:8:12: error: invalid types 'int[int]' for array subscript st[vf[0]]=x; ^ hercule.cpp:9:12: error: invalid types 'int[int]' for array subscript st[vf[1]]=y; ^ hercule.cpp:12:15: error: 'max' was not declared in this scope if(vf>max) max=vf; ^ hercule.cpp:16:12: error: 'a' was not declared in this scope if(a[x+1][y]<a[x][y]), back(x+1,y-1,vf+1); ^ hercule.cpp:16:30: error: expected primary-expression before ',' token if(a[x+1][y]<a[x][y]), back(x+1,y-1,vf+1); ^ hercule.cpp:17:12: error: 'a' was not declared in this scope if(a[x][y+1]<a[x][y]), back(x,y+1,vf+1); ^ hercule.cpp:17: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:22:5: error: 'fin' was not declared in this scope fin>>n>>m; ^ hercule.cpp:24:13: error: expected ')' before ';' token for((j=1;j<=n;j++) ^ hercule.cpp:25:14: error: 'a' was not declared in this scope fin>>a[i][j]; ^ hercule.cpp:26:14: error: 'stx' was not declared in this scope fin>>stx>>sty; ^ hercule.cpp:26:19: error: 'sty' was not declared in this scope fin>>stx>>sty; ^ hercule.cpp:28: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ă.