#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 | #16118932 | Utilizator | |
Fișier | hercule.cpp | Dimensiune | 3.26 KB |
Data încărcării | 04 Iunie 2019, 16:43 | Scor / rezultat | Eroare de compilare |
hercule.cpp:76:1: error: 'sau' does not name a type sau ^ hercule.cpp:80:12: error: redefinition of 'std::ifstream is' ifstream is("hercule.in"); ^ hercule.cpp:3:10: error: 'std::ifstream is' previously declared here ifstream is("hercule.in"); ^ hercule.cpp:81:12: error: redefinition of 'std::ofstream os' ofstream os("hercule.out"); ^ hercule.cpp:4:10: error: 'std::ofstream os' previously declared here ofstream os("hercule.out"); ^ hercule.cpp:82:14: error: redefinition of 'const int di []' const int di[]={-1,0,1,0}; ^ hercule.cpp:5:11: error: 'const int di [4]' previously defined here const int di[]={-1,0,1,0}; ^ hercule.cpp:83:14: error: redefinition of 'const int dj []' const int dj[]={0,1,0,-1}; ^ hercule.cpp:6:11: error: 'const int dj [4]' previously defined here const int dj[]={0,1,0,-1}; ^ hercule.cpp:84:15: error: redefinition of 'int a [100][100]' int a[100][100], x[100][100], m,n,pmin=10000,nr=0; ^ hercule.cpp:7:5: error: 'int a [100][100]' previously declared here int a[100][100], x[100][100], m,n,pmin=10000,nr=0; ^ hercule.cpp:84:28: error: redefinition of 'int x [100][100]' int a[100][100], x[100][100], m,n,pmin=10000,nr=0; ^ hercule.cpp:7:18: error: 'int x [100][100]' previously declared here int a[100][100], x[100][100], m,n,pmin=10000,nr=0; ^ hercule.cpp:84:31: error: redefinition of 'int m' int a[100][100], x[100][100], m,n,pmin=10000,nr=0; ^ hercule.cpp:7:31: error: 'int m' previously declared here int a[100][100], x[100][100], m,n,pmin=10000,nr=0; ^ hercule.cpp:84:33: error: redefinition of 'int n' int a[100][100], x[100][100], m,n,pmin=10000,nr=0; ^ hercule.cpp:7:33: error: 'int n' previously declared here int a[100][100], x[100][100], m,n,pmin=10000,nr=0; ^ hercule.cpp:84:35: error: redefinition of 'int pmin' int a[100][100], x[100][100], m,n,pmin=10000,nr=0; ^ hercule.cpp:7:35: error: 'int pmin' previously defined here int a[100][100], x[100][100], m,n,pmin=10000,nr=0; ^ hercule.cpp:84:46: error: redefinition of 'int nr' int a[100][100], x[100][100], m,n,pmin=10000,nr=0; ^ hercule.cpp:7:46: error: 'int nr' previously defined here int a[100][100], x[100][100], m,n,pmin=10000,nr=0; ^ hercule.cpp: In function 'void citire()': hercule.cpp:86:6: error: redefinition of 'void citire()' void citire() ^ hercule.cpp:9:6: error: 'void citire()' previously defined here void citire() ^ hercule.cpp: In function 'void afis(int (*)[100])': hercule.cpp:94:6: error: redefinition of 'void afis(int (*)[100])' void afis(int x[100][100]) ^ hercule.cpp:17:6: error: 'void afis(int (*)[100])' previously defined here void afis(int x[100][100]) ^ hercule.cpp: In function 'void alege(int)': hercule.cpp:105:6: error: redefinition of 'void alege(int)' void alege(int pas) ^ hercule.cpp:28:6: error: 'void alege(int)' previously defined here void alege(int pas)//alege minimul si numarul de drumuri de lungime minima ^ hercule.cpp: In function 'void back(int, int, int)': hercule.cpp:125:6: error: redefinition of 'void back(int, int, int)' void back(int i, int j, int pas) ^ hercule.cpp:34:6: error: 'void back(int, int, int)' previously defined here void back(int i, int j, int pas) ^ hercule.cpp: In function 'void backmin(int, int, int)': hercule.cpp:144:6: error: redefinition of 'void backmin(int, int, int)' void backmin(int i, int j, int pas) //face doar drumurile de lungime minima ^ hercule.cpp:49:6: error: 'void backmin(int, int, int)' previously defined here void backmin(int i, int j, int pas) //face doar drumurile de lungime minima ^ hercule.cpp: In function 'int main()': hercule.cpp:163:5: error: redefinition of 'int main()' int main() ^ hercule.cpp:64: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ă.