#884
Paznici
Se consideră o clădire de formă dreptunghiulară, formată din n*m
camere dispuse sub forma unei matrice cu n
linii și m
coloane. Anumite camere sunt ocupate şi nu pot fi vizitate, celelalte sunt libere și pot fi vizitate. Dintr-o cameră se poate trece în altă cameră dacă ambele sunt libere și se învecinează pe linie sau pe coloană.
În anumite camere sunt paznici. Din motive de securitate, paznicii se pot deplasa din camera inițială în anumite camere libere din apropiere, dar fără a se îndepărta la o distanță mai mare decât o valoare cunoscută. Fiecare paznic va verifica periodic camerele libere în care poate ajunge.
Să se determine numărul de camere din clădire care nu sunt verificate de niciun paznic.
Problema | Paznici | Operații I/O |
paznici.in /paznici.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #47301858 | Utilizator | |
Fișier | paznici.cpp | Dimensiune | 3.06 KB |
Data încărcării | 08 Decembrie 2023, 23:49 | Scor / rezultat | Eroare de compilare |
paznici.cpp:95:13: error: redefinition of 'std::ifstream fin' ifstream fin("paznici.in"); ^ paznici.cpp:5:10: error: 'std::ifstream fin' previously declared here ifstream fin("paznici.in"); ^ paznici.cpp:96:14: error: redefinition of 'std::ofstream fout' ofstream fout("paznici.out"); ^ paznici.cpp:6:10: error: 'std::ofstream fout' previously declared here ofstream fout("paznici.out"); ^ paznici.cpp:98:14: error: redefinition of 'const int di []' const int di[] = {0 , 0 , -1 , 1}; ^ paznici.cpp:8:11: error: 'const int di [4]' previously defined here const int di[] = {0 , 0 , -1 , 1}; ^ paznici.cpp:99:14: error: redefinition of 'const int dj []' const int dj[] = {-1 , 1 , 0 , 0}; ^ paznici.cpp:9:11: error: 'const int dj [4]' previously defined here const int dj[] = {-1 , 1 , 0 , 0}; ^ paznici.cpp:101:5: error: redefinition of 'int n' int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:11:5: error: 'int n' previously declared here int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:101:8: error: redefinition of 'int m' int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:11:8: error: 'int m' previously declared here int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:101:11: error: redefinition of 'int p' int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:11:11: error: 'int p' previously declared here int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:101:24: error: redefinition of 'int a [205][205]' int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:11:14: error: 'int a [205][205]' previously declared here int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:101:37: error: redefinition of 'int b [205][205]' int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:11:27: error: 'int b [205][205]' previously declared here int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:101:50: error: redefinition of 'int c [205][205]' int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:11:40: error: 'int c [205][205]' previously declared here int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:101:53: error: redefinition of 'int t' int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:11:53: error: 'int t' previously declared here int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:101:56: error: redefinition of 'int x' int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:11:56: error: 'int x' previously declared here int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:101:59: error: redefinition of 'int y' int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:11:59: error: 'int y' previously declared here int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:101:62: error: redefinition of 'int val' int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:11:62: error: 'int val' previously declared here int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:101:67: error: redefinition of 'int cnt' int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:11:67: error: 'int cnt' previously declared here int n, m, p, a[205][205], b[205][205], c[205][205], t, x, y, val, cnt; ^ paznici.cpp:102:18: error: redefinition of 'char mat [205][205]' char mat[205][205]; ^ paznici.cpp:12:6: error: 'char mat [205][205]' previously declared here char mat[205][205]; ^ paznici.cpp:104:8: error: redefinition of 'struct poz' struct poz ^ paznici.cpp:14:8: error: previous definition of 'struct poz' struct poz ^ paznici.cpp:109:12: error: redefinition of 'std::queue<poz> q' queue <poz>q; ^ paznici.cpp:19:12: error: 'std::queue<poz> q' previously declared here queue <poz>q; ^ paznici.cpp: In function 'int verif(int, int)': paznici.cpp:111:5: error: redefinition of 'int verif(int, int)' int verif(int i , int j) ^ paznici.cpp:21:5: error: 'int verif(int, int)' previously defined here int verif(int i , int j) ^ paznici.cpp: In function 'void lee(int, int, int)': paznici.cpp:115:6: error: redefinition of 'void lee(int, int, int)' void lee(int x, int y, int val) ^ paznici.cpp:25:6: error: 'void lee(int, int, int)' previously defined here void lee(int x, int y, int val) ^ paznici.cpp: In function 'int main()': paznici.cpp:154:5: error: redefinition of 'int main()' int main() ^ paznici.cpp:64:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Paznici 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ă.