#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 | #8328402 | Utilizator | |
Fișier | hercule.cpp | Dimensiune | 2.51 KB |
Data încărcării | 16 Februarie 2018, 10:13 | Scor / rezultat | Eroare de compilare |
hercule.cpp:4:48: error: array must be initialized with a brace-enclosed initializer int st[100][2],a[11][11],n,m,k,xi,yi,b[11][11]=0,p,k,sol; ^ hercule.cpp:4:52: error: redefinition of 'int k' int st[100][2],a[11][11],n,m,k,xi,yi,b[11][11]=0,p,k,sol; ^ hercule.cpp:4:30: error: 'int k' previously declared here int st[100][2],a[11][11],n,m,k,xi,yi,b[11][11]=0,p,k,sol; ^ hercule.cpp: In function 'int valid(int)': hercule.cpp:23:9: error: expected ',' or ';' before 'return' return 0; ^ hercule.cpp: In function 'int main()': hercule.cpp:72:1: error: 'ast' was not declared in this scope ast[p][0]=1;st[1][1]=1; ^ hercule.cpp: At global scope: hercule.cpp:99:13: error: conflicting declaration 'int st [40][2]' int st[40][2],a[7][7],n,m,k,xi,yi,sol; ^ hercule.cpp:4:5: error: 'st' has a previous declaration as 'int st [100][2]' int st[100][2],a[11][11],n,m,k,xi,yi,b[11][11]=0,p,k,sol; ^ hercule.cpp:99:21: error: conflicting declaration 'int a [7][7]' int st[40][2],a[7][7],n,m,k,xi,yi,sol; ^ hercule.cpp:4:16: error: 'a' has a previous declaration as 'int a [11][11]' int st[100][2],a[11][11],n,m,k,xi,yi,b[11][11]=0,p,k,sol; ^ hercule.cpp:99:23: error: redefinition of 'int n' int st[40][2],a[7][7],n,m,k,xi,yi,sol; ^ hercule.cpp:4:26: error: 'int n' previously declared here int st[100][2],a[11][11],n,m,k,xi,yi,b[11][11]=0,p,k,sol; ^ hercule.cpp:99:25: error: redefinition of 'int m' int st[40][2],a[7][7],n,m,k,xi,yi,sol; ^ hercule.cpp:4:28: error: 'int m' previously declared here int st[100][2],a[11][11],n,m,k,xi,yi,b[11][11]=0,p,k,sol; ^ hercule.cpp:99:27: error: redefinition of 'int k' int st[40][2],a[7][7],n,m,k,xi,yi,sol; ^ hercule.cpp:4:30: error: 'int k' previously declared here int st[100][2],a[11][11],n,m,k,xi,yi,b[11][11]=0,p,k,sol; ^ hercule.cpp:99:29: error: redefinition of 'int xi' int st[40][2],a[7][7],n,m,k,xi,yi,sol; ^ hercule.cpp:4:32: error: 'int xi' previously declared here int st[100][2],a[11][11],n,m,k,xi,yi,b[11][11]=0,p,k,sol; ^ hercule.cpp:99:32: error: redefinition of 'int yi' int st[40][2],a[7][7],n,m,k,xi,yi,sol; ^ hercule.cpp:4:35: error: 'int yi' previously declared here int st[100][2],a[11][11],n,m,k,xi,yi,b[11][11]=0,p,k,sol; ^ hercule.cpp:99:35: error: redefinition of 'int sol' int st[40][2],a[7][7],n,m,k,xi,yi,sol; ^ hercule.cpp:4:54: error: 'int sol' previously declared here int st[100][2],a[11][11],n,m,k,xi,yi,b[11][11]=0,p,k,sol; ^ hercule.cpp:100:8: error: redefinition of 'int dx []' int dx[]={0,-1,0,1,0},dy[]={0,0,1,0,-1},b[11][11]={0}; ^ hercule.cpp:5:5: error: 'int dx [5]' previously defined here int dx[]={0,-1,0,1,0}, ^ hercule.cpp:100:26: error: redefinition of 'int dy []' int dx[]={0,-1,0,1,0},dy[]={0,0,1,0,-1},b[11][11]={0}; ^ hercule.cpp:6:1: error: 'int dy [5]' previously defined here dy[]={0,0,1,0,-1}; ^ hercule.cpp:100:49: error: redefinition of 'int b [11][11]' int dx[]={0,-1,0,1,0},dy[]={0,0,1,0,-1},b[11][11]={0}; ^ hercule.cpp:4:38: error: 'int b [11][11]' previously defined here int st[100][2],a[11][11],n,m,k,xi,yi,b[11][11]=0,p,k,sol; ^ hercule.cpp:101:13: error: redefinition of 'std::ifstream fin' ifstream fin("fisiere.in"); ^ hercule.cpp:7:10: error: 'std::ifstream fin' previously declared here ifstream fin("hercule.in"); ^ hercule.cpp:102:14: error: redefinition of 'std::ofstream fout' ofstream fout("fisiere.out"); ^ hercule.cpp:8:10: error: 'std::ofstream fout' previously declared here ofstream fout("hercule.out"); ^ hercule.cpp: In function 'void init()': hercule.cpp:103:6: error: redefinition of 'void init()' void init() ^ hercule.cpp:10:6: error: 'void init()' previously defined here void init() ^ hercule.cpp: In function 'int valid(int)': hercule.cpp:112:5: error: redefinition of 'int valid(int)' int valid(int p) ^ hercule.cpp:20:5: error: 'int valid(int)' previously defined here int valid(int p) ^ hercule.cpp: In function 'int solutie(int)': hercule.cpp:123:5: error: redefinition of 'int solutie(int)' int solutie(int p) ^ hercule.cpp:32:5: error: 'int solutie(int)' previously defined here int solutie(int p) ^ hercule.cpp: In function 'void afis()': hercule.cpp:128:6: error: redefinition of 'void afis()' void afis() ^ hercule.cpp:37:6: error: 'void afis()' previously defined here void afis() ^ hercule.cpp: In function 'void bk(int)': hercule.cpp:132:6: error: redefinition of 'void bk(int)' void bk(int p) ^ hercule.cpp:48:6: error: 'void bk(int)' previously defined here void bk(int p) ^ hercule.cpp: In function 'int main()': hercule.cpp:152:5: error: redefinition of 'int main()' int main() ^ hercule.cpp:68:5: error: 'int main()' previously defined here int main() ^
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ă.