#4819
Gușteru’ a descoperit într-un dulap un vechi joc de aventură, numit Ijnamuj. Jocul inițial pornește de la nivelul 1, iar scopul este completarea a cât mai multor nivele. Fiecare nivel i are asociată o listă L(i) care conține alte nivele din joc. Pentru a completa nivelul i, Gușteru’ va trebui mai întâi să completeze toate nivelele din lista L(i), în orice ordine dorește el. După completarea oricărui nivel, el poate să completeze orice alt nivel a cărui listă conține numai nivele completate. Pentru că jocul începe de la nivelul 1, lista L(1) va fi mereu vidă, adică completarea lui nu este restricționată de niciun alt nivel. Care este numărul maxim de nivele pe care le poate completa Gușteru’?
OJI 2025, clasele 11-12
| Problema | aventura | Operații I/O |
aventura.in/aventura.out
|
|---|---|---|---|
| Limita timp | 3.5 secunde | Limita memorie |
Total: 256 MB
/
Stivă 64 MB
|
| Id soluție | #63382935 | Utilizator | |
| Fișier | aventura.cpp | Dimensiune | 3.29 KB |
| Data încărcării | 01 Martie 2026, 00:44 | Scor/rezultat | Eroare de compilare |
aventura.cpp:3:12: warning: missing terminating " character [enabled by default] ifstream f("aventura.in); ^ aventura.cpp:3:1: error: missing terminating " character ifstream f("aventura.in); ^ aventura.cpp:4:12: warning: missing terminating " character [enabled by default] ofstream g("aventura.out); ^ aventura.cpp:4:1: error: missing terminating " character ofstream g("aventura.out); ^ aventura.cpp:5:11: error: expected ')' before '{' token int main(){ ^ aventura.cpp:5:11: error: expected ')' before '{' token aventura.cpp: In function 'std::ifstream f(std::ofstream (*)(int (*)()))': aventura.cpp:10:7: error: invalid operands of types 'std::ifstream(std::ofstream (*)(int (*)())) {aka std::basic_ifstream<char>(std::basic_ofstream<char> (*)(int (*)()))}' and 'int' to binary 'operator>>' f >> T; ^ aventura.cpp:14:7: error: invalid operands of types 'std::ifstream(std::ofstream (*)(int (*)())) {aka std::basic_ifstream<char>(std::basic_ofstream<char> (*)(int (*)()))}' and 'int' to binary 'operator>>' f >> N; ^ aventura.cpp:21:14: error: invalid operands of types 'std::ifstream(std::ofstream (*)(int (*)())) {aka std::basic_ifstream<char>(std::basic_ofstream<char> (*)(int (*)()))}' and 'int' to binary 'operator>>' int k; f >> k; ^ aventura.cpp:23:14: error: invalid operands of types 'std::ifstream(std::ofstream (*)(int (*)())) {aka std::basic_ifstream<char>(std::basic_ofstream<char> (*)(int (*)()))}' and 'int' to binary 'operator>>' int x; f >> x; ^ aventura.cpp:41:8: error: expected unqualified-id before '[' token auto &[u, idx] = st.top(); ^ aventura.cpp:41:8: error: expected initializer before '[' token aventura.cpp:42:5: error: 'idx' was not declared in this scope if(idx < (int)adj[u].size()){ ^ aventura.cpp:42:20: error: 'u' was not declared in this scope if(idx < (int)adj[u].size()){ ^ aventura.cpp:119:1: error: 'completabile' was not declared in this scope completabile ^ aventura.cpp:122:2: error: expected ';' before 'int' int startComp = comp[1]; ^ aventura.cpp:127:17: error: 'startComp' was not declared in this scope if(completable[startComp]){ ^ aventura.cpp:148:7: error: invalid operands of types 'std::ofstream (*)(int (*)()) {aka std::basic_ofstream<char> (*)(int (*)())}' and 'long long int' to binary 'operator<<' g << ans << "\n"; ^ aventura.cpp:151:9: error: could not convert '0' from 'int' to 'std::ifstream {aka std::basic_ifstream<char>}' return 0; ^ aventura.cpp:152:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema aventura 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ă.