#3380
Castel2
Se consideră un castel de formă dreptunghiulară, alcătuit din n*m
camere dispuse pe n
linii și m
coloane. Intrarea în castel este în camera de coordonate (1,1)
, ieșirea în camera de coordonate n,m
, unele camere sunt închise, dintr-o cameră se poate trece în camerele învecinate pe linie și pe coloană, iar unele camere sunt ocupate de zmei gripați, fiecare zmeu afectând camera sa și camere aflate în jurul său la distanța mai mică sau egală cu k
.
Pentru a câștiga inima Ilenei Cosânzeana, Făt-Frumos trebuie să traverseze castelul. Deoarece nu se pricepe la informatică vă roagă pe voi să determinați care este lungimea minimă a unui traseu care traversează castelul, trece doar prin camere deschise și nu trece prin camere afectate de zmei.
Problema | Castel2 | Operații I/O |
castel2.in /castel2.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53792679 | Utilizator | |
Fișier | castel2.cpp | Dimensiune | 3.12 KB |
Data încărcării | 11 Noiembrie 2024, 21:15 | Scor / rezultat | Eroare de compilare |
castel2.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ castel2.cpp:1:7: error: 'System' has not been declared castel2.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ castel2.cpp:2:7: error: 'System' has not been declared castel2.cpp:2:13: error: expected ';' before '.' token using System.Collections.Generic; ^ castel2.cpp:2:13: error: expected unqualified-id before '.' token castel2.cpp:3:7: error: expected nested-name-specifier before 'System' using System.IO; ^ castel2.cpp:3:7: error: 'System' has not been declared castel2.cpp:3:13: error: expected ';' before '.' token using System.IO; ^ castel2.cpp:3:13: error: expected unqualified-id before '.' token castel2.cpp:7:15: error: expected unqualified-id before '[' token static int[] di = { -1, 1, 0, 0 }; ^ castel2.cpp:8:15: error: expected unqualified-id before '[' token static int[] dj = { 0, 0, -1, 1 }; ^ castel2.cpp:10:16: error: expected unqualified-id before '[' token static char[,] a; ^ castel2.cpp:11:16: error: expected unqualified-id before '[' token static bool[,] b; ^ castel2.cpp:15:16: error: expected ':' before 'int' public int x; ^ castel2.cpp:16:16: error: expected ':' before 'int' public int y; ^ castel2.cpp:17:5: error: expected ';' after struct definition } ^ castel2.cpp:21:16: error: expected ':' before 'int' public int x; ^ castel2.cpp:22:16: error: expected ':' before 'int' public int y; ^ castel2.cpp:23:16: error: expected ':' before 'int' public int z; ^ castel2.cpp:24:5: error: expected ';' after struct definition } ^ castel2.cpp:52:25: error: expected primary-expression before ',' token static int Lee(char[,] a, bool[,] b, int n, int m) ^ castel2.cpp:52:25: error: expected ']' before ',' token castel2.cpp:52:25: error: expected ')' before ',' token castel2.cpp:52:26: error: expected unqualified-id before ']' token static int Lee(char[,] a, bool[,] b, int n, int m) ^ castel2.cpp:114:1: error: expected '}' at end of input } ^ castel2.cpp: In static member function 'static void Program::Main()': castel2.cpp:28:9: error: 'StreamReader' was not declared in this scope StreamReader fin = new StreamReader("castel2.in"); ^ castel2.cpp:28:22: error: expected ';' before 'fin' StreamReader fin = new StreamReader("castel2.in"); ^ castel2.cpp:29:9: error: 'StreamWriter' was not declared in this scope StreamWriter fout = new StreamWriter("castel2.out"); ^ castel2.cpp:29:22: error: expected ';' before 'fout' StreamWriter fout = new StreamWriter("castel2.out"); ^ castel2.cpp:30:9: error: 'string' was not declared in this scope string[] s2 = fin.ReadLine().Split(); ^ castel2.cpp:30:16: error: expected primary-expression before ']' token string[] s2 = fin.ReadLine().Split(); ^ castel2.cpp:30:18: error: expected ';' before 's2' string[] s2 = fin.ReadLine().Split(); ^ castel2.cpp:31:13: error: expected primary-expression before 'int' n = int.Parse(s2[0]); ^ castel2.cpp:31:13: error: expected ';' before 'int' castel2.cpp:32:13: error: expected primary-expression before 'int' m = int.Parse(s2[1]); ^ castel2.cpp:32:13: error: expected ';' before 'int' castel2.cpp:33:13: error: expected primary-expression before 'int' k = int.Parse(s2[2]); ^ castel2.cpp:33:13: error: expected ';' before 'int' castel2.cpp:34:9: error: 'a' was not declared in this scope a = new char[n, m]; ^ castel2.cpp:34:25: warning: left operand of comma operator has no effect [-Wunused-value] a = new char[n, m]; ^ castel2.cpp:35:9: error: 'b' was not declared in this scope b = new bool[n, m]; ^ castel2.cpp:35:25: warning: left operand of comma operator has no effect [-Wunused-value] b = new bool[n, m]; ^ castel2.cpp:38:20: error: expected ';' before 's' string s = fin.ReadLine().Trim(); ^ castel2.cpp:41:22: warning: left operand of comma operator has no effect [-Wunused-value] a[i, j] = s[j]; ^ castel2.cpp:41:27: error: 's' was not declared in this scope a[i, j] = s[j]; ^ castel2.cpp:42:26: warning: left operand of comma operator has no effect [-Wunused-value] if (a[i, j] == 'Z') ^ castel2.cpp:43:49: error: 'Infectat' was not declared in this scope Infectat(a, b, n, m, i, j, k); ^ castel2.cpp:47:9: error: 'fout' was not declared in this scope fout.WriteLine(result); ^ castel2.cpp:48:9: error: 'fin' was not declared in this scope fin.Close(); ^ castel2.cpp: At global scope: castel2.cpp:50:5: error: expected unqualified-id at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Castel2 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ă.