#329
Bila
Se consideră o tablă de joc de formă dreptunghiulară, împărţită în n
linii şi m
coloane. Se obţin astfel n*m
zone şi se cunoaște înălțimea fiecărei zone. La o poziție cunoscută – linia istart
, coloana jstart
se află o bilă care se poate deplasa pe o poziție vecină (sus, jos, stânga, dreapta) doar dacă înălțimea poziției vecine este strict mai mică decât înălțimea poziției curente.
Determinați numărul maxim de zone prin care poate să treacă bila pentru a ajunge pe una dintre marginile tablei de joc.
Problema | Bila | Operații I/O |
bila.in /bila.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #24768806 | Utilizator | |
Fișier | bila.cpp | Dimensiune | 2.06 KB |
Data încărcării | 19 Octombrie 2020, 09:55 | Scor / rezultat | Eroare de compilare |
bila.cpp:61:2: error: stray '#' in program }#include <iostream> ^ bila.cpp:61:3: error: 'include' does not name a type }#include <iostream> ^ bila.cpp:64:13: error: redefinition of 'std::ifstream in' ifstream in ("bila.in"); ^ bila.cpp:4:10: error: 'std::ifstream in' previously declared here ifstream in ("bila.in"); ^ bila.cpp:65:14: error: redefinition of 'std::ofstream out' ofstream out ("bila.out"); ^ bila.cpp:5:10: error: 'std::ofstream out' previously declared here ofstream out ("bila.out"); ^ bila.cpp:66:8: error: redefinition of 'struct stiva' struct stiva ^ bila.cpp:6:8: error: previous definition of 'struct stiva' struct stiva ^ bila.cpp:70:12: error: redefinition of 'stiva st [22]' stiva st[22]; ^ bila.cpp:10:7: error: 'stiva st [22]' previously declared here stiva st[22]; ^ bila.cpp:71:5: error: redefinition of 'int n' int n,m,a[21][21],k,istart,jstart; ^ bila.cpp:11:5: error: 'int n' previously declared here int n,m,a[21][21],k,istart,jstart; ^ bila.cpp:71:7: error: redefinition of 'int m' int n,m,a[21][21],k,istart,jstart; ^ bila.cpp:11:7: error: 'int m' previously declared here int n,m,a[21][21],k,istart,jstart; ^ bila.cpp:71:17: error: redefinition of 'int a [21][21]' int n,m,a[21][21],k,istart,jstart; ^ bila.cpp:11:9: error: 'int a [21][21]' previously declared here int n,m,a[21][21],k,istart,jstart; ^ bila.cpp:71:19: error: redefinition of 'int k' int n,m,a[21][21],k,istart,jstart; ^ bila.cpp:11:19: error: 'int k' previously declared here int n,m,a[21][21],k,istart,jstart; ^ bila.cpp:71:21: error: redefinition of 'int istart' int n,m,a[21][21],k,istart,jstart; ^ bila.cpp:11:21: error: 'int istart' previously declared here int n,m,a[21][21],k,istart,jstart; ^ bila.cpp:71:28: error: redefinition of 'int jstart' int n,m,a[21][21],k,istart,jstart; ^ bila.cpp:11:28: error: 'int jstart' previously declared here int n,m,a[21][21],k,istart,jstart; ^ bila.cpp:72:9: error: redefinition of 'int dl [4]' int dl[4]= {-1,0,1,0},dc[4]= {0,1,0,-1}; ^ bila.cpp:12:5: error: 'int dl [4]' previously defined here int dl[4]= {-1,0,1,0},dc[4]= {0,1,0,-1}; ^ bila.cpp:72:27: error: redefinition of 'int dc [4]' int dl[4]= {-1,0,1,0},dc[4]= {0,1,0,-1}; ^ bila.cpp:12:23: error: 'int dc [4]' previously defined here int dl[4]= {-1,0,1,0},dc[4]= {0,1,0,-1}; ^ bila.cpp: In function 'void citire()': bila.cpp:74:6: error: redefinition of 'void citire()' void citire() ^ bila.cpp:14:6: error: 'void citire()' previously defined here void citire() ^ bila.cpp: In function 'void bkt(int, int, int)': bila.cpp:82:6: error: redefinition of 'void bkt(int, int, int)' void bkt (int k, int lin, int col) ^ bila.cpp:22:6: error: 'void bkt(int, int, int)' previously defined here void bkt (int k, int lin, int col) ^ bila.cpp: In function 'int main()': bila.cpp:111:5: error: redefinition of 'int main()' int main() ^ bila.cpp:51:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Bila 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ă.