#675
BiFrunze
Se dă un arbore binar care conține valori numere naturale. Să se afișeze frunzele acestui arbore.
Problema | BiFrunze | Operații I/O |
bifrunze.in /bifrunze.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53416397 | Utilizator | |
Fișier | bifrunze.cpp | Dimensiune | 782 B |
Data încărcării | 29 Octombrie 2024, 13:53 | Scor / rezultat | Eroare de compilare |
bifrunze.cpp: In function 'int main()': bifrunze.cpp:16:5: error: reference to 'cin' is ambiguous cin >> n; ^ bifrunze.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("bifrunze.in"); ^ In file included from bifrunze.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ bifrunze.cpp:18:5: error: 'vector' was not declared in this scope vector<Node> tree(n + 1); ^ bifrunze.cpp:18:16: error: expected primary-expression before '>' token vector<Node> tree(n + 1); ^ bifrunze.cpp:18:28: error: 'tree' was not declared in this scope vector<Node> tree(n + 1); ^ bifrunze.cpp:21:9: error: reference to 'cin' is ambiguous cin >> tree[i].value >> tree[i].left >> tree[i].right; ^ bifrunze.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("bifrunze.in"); ^ In file included from bifrunze.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ bifrunze.cpp:24:12: error: expected primary-expression before 'int' vector<int> leaves; ^ bifrunze.cpp:24:12: error: expected ';' before 'int' bifrunze.cpp:28:13: error: 'leaves' was not declared in this scope leaves.push_back(i); ^ bifrunze.cpp:33:10: error: 'leaves' was not declared in this scope sort(leaves.begin(), leaves.end()); ^ bifrunze.cpp:33:38: error: 'sort' was not declared in this scope sort(leaves.begin(), leaves.end()); ^ bifrunze.cpp:37:9: error: reference to 'cout' is ambiguous cout << leaves[i]; ^ bifrunze.cpp:6:10: note: candidates are: std::ofstream cout ofstream cout("bifrunze.out"); ^ In file included from bifrunze.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ bifrunze.cpp:39:13: error: reference to 'cout' is ambiguous cout << " "; ^ bifrunze.cpp:6:10: note: candidates are: std::ofstream cout ofstream cout("bifrunze.out"); ^ In file included from bifrunze.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema BiFrunze 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ă.