#636
Se dau cele n-1 muchii ale unui arbore cu n noduri și un nod k . Afișați vectorul de tați al arborelui cu rădăcina în k.
| Problema | Arbore | Operații I/O |
arbore.in/arbore.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #62194650 | Utilizator | |
| Fișier | arbore.cpp | Dimensiune | 1.36 KB |
| Data încărcării | 13 Ianuarie 2026, 11:33 | Scor/rezultat | Eroare de compilare |
arbore.cpp:14:5: error: stray '\342' in program for (int i = I’m continuing from the previous code block and finishing it correctly (the earlier message cut off mid-line). ^ arbore.cpp:14:5: error: stray '\200' in program arbore.cpp:14:5: error: stray '\231' in program arbore.cpp:18:1: error: stray '\`' in program \`\`\`cpp ^ arbore.cpp:18:1: error: stray '\`' in program arbore.cpp:18:1: error: stray '\`' in program arbore.cpp: In function 'int main()': arbore.cpp:14:18: error: 'I' was not declared in this scope for (int i = I’m continuing from the previous code block and finishing it correctly (the earlier message cut off mid-line). ^ arbore.cpp:24:10: warning: declaration of 'int main()' has 'extern' and is initialized [enabled by default] int main() { ^ arbore.cpp:25:14: error: expected primary-expression before 'fin' ifstream fin("arbore.in"); ^ arbore.cpp:25:14: error: expected '}' before 'fin' arbore.cpp:25:14: error: function 'int main()' is initialized like a variable arbore.cpp:25:14: warning: the address of 'int main()' will always evaluate as 'true' [-Waddress] arbore.cpp:25:14: error: expected ';' before 'fin' arbore.cpp:25:29: error: no match for call to '(std::ifstream {aka std::basic_ifstream<char>}) (const char [10])' ifstream fin("arbore.in"); ^ arbore.cpp:25:30: error: expected ')' before ';' token ifstream fin("arbore.in"); ^ arbore.cpp:14:14: warning: unused variable 'i' [-Wunused-variable] for (int i = I’m continuing from the previous code block and finishing it correctly (the earlier message cut off mid-line). ^ arbore.cpp:26:18: error: redeclaration of 'std::ofstream fout' ofstream fout("arbore.out"); ^ arbore.cpp:8:14: error: 'std::ofstream fout' previously declared here ofstream fout("arbore.out"); ^ arbore.cpp:28:9: error: redeclaration of 'int n' int n, k; ^ arbore.cpp:10:9: error: 'int n' previously declared here int n, k; ^ arbore.cpp:28:12: error: redeclaration of 'int k' int n, k; ^ arbore.cpp:10:12: error: 'int k' previously declared here int n, k; ^ arbore.cpp:31:24: error: redeclaration of 'std::vector<int> adj [101]' vector<int> adj[101]; ^ arbore.cpp:13:17: error: 'std::vector<int> adj [101]' previously declared here vector<int> adj[101]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Arbore 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ă.