#2041
Pe o matrice de dimensiune m linii și n coloane se cunosc coordonatele castelului și a k cavaleri. Se cere să se determine:
1. numărul minim de mutări după care va ajunge la castel unul dintre cavaleri
2. numărul minim de mutări după care toţi cavalerii se vor afla la castel.
OLI 2017 judetul CLUJ
| Problema | camelot | Operații I/O |
camelot.in/camelot.out
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63086287 | Utilizator | |
| Fișier | camelot.cpp | Dimensiune | 3.49 KB |
| Data încărcării | 13 Februarie 2026, 09:32 | Scor/rezultat | Eroare de compilare |
camelot.cpp:79:12: error: redefinition of 'std::ifstream be' ifstream be("camelot.in"); ^ camelot.cpp:5:10: error: 'std::ifstream be' previously declared here ifstream be("camelot.in"); ^ camelot.cpp:80:12: error: redefinition of 'std::ofstream ki' ofstream ki("camelot.out"); ^ camelot.cpp:6:10: error: 'std::ofstream ki' previously declared here ofstream ki("camelot.out"); ^ camelot.cpp:82:5: error: redefinition of 'int n' int n, m; ^ camelot.cpp:8:5: error: 'int n' previously declared here int n, m; ^ camelot.cpp:82:8: error: redefinition of 'int m' int n, m; ^ camelot.cpp:8:8: error: 'int m' previously declared here int n, m; ^ camelot.cpp:83:5: error: redefinition of 'int x_var' int x_var, y_var; ^ camelot.cpp:9:5: error: 'int x_var' previously declared here int x_var, y_var; ^ camelot.cpp:83:12: error: redefinition of 'int y_var' int x_var, y_var; ^ camelot.cpp:9:12: error: 'int y_var' previously declared here int x_var, y_var; ^ camelot.cpp:84:8: error: redefinition of 'int dx []' int dx[] = {2, 1, -1, -2, -2, -1, 1, 2}; ^ camelot.cpp:10:5: error: 'int dx [8]' previously defined here int dx[] = {2, 1, -1, -2, -2, -1, 1, 2}; ^ camelot.cpp:85:8: error: redefinition of 'int dy []' int dy[] = {1, 2, 2, 1, -1, -2, -2, -1}; ^ camelot.cpp:11:5: error: 'int dy [8]' previously defined here int dy[] = {1, 2, 2, 1, -1, -2, -2, -1}; ^ camelot.cpp: In function 'bool jo(int, int, std::vector<std::vector<bool> >&)': camelot.cpp:87:6: error: redefinition of 'bool jo(int, int, std::vector<std::vector<bool> >&)' bool jo(int x, int y, vector<vector<bool>> &l){ ^ camelot.cpp:13:6: error: 'bool jo(int, int, std::vector<std::vector<bool> >&)' previously defined here bool jo(int x, int y, vector<vector<bool>> &l){ ^ camelot.cpp: In function 'int hossz(int, int)': camelot.cpp:93:5: error: redefinition of 'int hossz(int, int)' int hossz(int i, int j){ ^ camelot.cpp:19:5: error: 'int hossz(int, int)' previously defined here int hossz(int i, int j){ ^ camelot.cpp: In function 'int main()': camelot.cpp:125:5: error: redefinition of 'int main()' int main() ^ camelot.cpp:51:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema camelot 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ă.