#3503
Biarbore1
Se consideră un arbore binar în care nodurile memorează numere naturale nenule. Să se determine valorile memorate în descendenții direcți ai rădăcinii arborelui.
Programul citește lista valorilor din arbore, dată în ordinea parcurgerii în preordine.
Problema | Biarbore1 | Operații I/O |
![]() biarbore1.in /biarbore1.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0.1 MB
|
Id soluție | #58242690 | Utilizator | |
Fișier | biarbore1.cpp | Dimensiune | 878 B |
Data încărcării | 21 Mai 2025, 22:49 | Scor / rezultat | Eroare de compilare |
biarbore1.cpp:9:11: error: invalid preprocessing directive #creeaz # creează nodul curent ^ biarbore1.cpp:10:16: warning: character constant too long for its type [enabled by default] nod = {'valoare': val} ^ biarbore1.cpp:11:13: warning: character constant too long for its type [enabled by default] nod['stang'], index = construieste(index) ^ biarbore1.cpp:12:13: warning: character constant too long for its type [enabled by default] nod['drept'], index = construieste(index) ^ biarbore1.cpp:24:3: error: invalid preprocessing directive #Extragem # Extragem valorile fiilor rădăcinii ^ biarbore1.cpp:25:20: warning: character constant too long for its type [enabled by default] fiu_stang = arbore['stang']['valoare'] if arbore['stang'] else 0 ^ biarbore1.cpp:25:29: warning: character constant too long for its type [enabled by default] fiu_stang = arbore['stang']['valoare'] if arbore['stang'] else 0 ^ biarbore1.cpp:25:50: warning: character constant too long for its type [enabled by default] fiu_stang = arbore['stang']['valoare'] if arbore['stang'] else 0 ^ biarbore1.cpp:26:20: warning: character constant too long for its type [enabled by default] fiu_drept = arbore['drept']['valoare'] if arbore['drept'] else 0 ^ biarbore1.cpp:26:29: warning: character constant too long for its type [enabled by default] fiu_drept = arbore['drept']['valoare'] if arbore['drept'] else 0 ^ biarbore1.cpp:26:50: warning: character constant too long for its type [enabled by default] fiu_drept = arbore['drept']['valoare'] if arbore['drept'] else 0 ^ biarbore1.cpp:1:1: error: 'def' does not name a type def citeste_arbore(lista): ^ biarbore1.cpp:11:9: error: 'nod' does not name a type nod['stang'], index = construieste(index) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Biarbore1 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ă.