#3693
Se dau un arbore binar complet infinit cu rădăcina în nodul 1 în care pentru orice nod i copiii săi sunt 2*i, respectiv 2*i+1 și Q perechi de numere u v. Se cere să se afle pentru fiecare pereche lungimea drumului(ca număr de muchii) dintre nodurile u și v din arbore.
| Problema | binary_tree | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
| Id soluție | #61103472 | Utilizator | |
| Fișier | binary_tree.cpp | Dimensiune | 794 B |
| Data încărcării | 19 Noiembrie 2025, 13:05 | Scor/rezultat | Eroare de compilare |
binary_tree.cpp:5:15: error: stray '#' in program int n,u,v,cnt;#include <bits/stdc++.h> ^ binary_tree.cpp:5:16: error: 'include' does not name a type int n,u,v,cnt;#include <bits/stdc++.h> ^ binary_tree.cpp:9:5: error: redefinition of 'int n' int n,u,v,cnt; ^ binary_tree.cpp:5:5: error: 'int n' previously declared here int n,u,v,cnt;#include <bits/stdc++.h> ^ binary_tree.cpp:9:7: error: redefinition of 'int u' int n,u,v,cnt; ^ binary_tree.cpp:5:7: error: 'int u' previously declared here int n,u,v,cnt;#include <bits/stdc++.h> ^ binary_tree.cpp:9:9: error: redefinition of 'int v' int n,u,v,cnt; ^ binary_tree.cpp:5:9: error: 'int v' previously declared here int n,u,v,cnt;#include <bits/stdc++.h> ^ binary_tree.cpp:9:11: error: redefinition of 'int cnt' int n,u,v,cnt; ^ binary_tree.cpp:5:11: error: 'int cnt' previously declared here int n,u,v,cnt;#include <bits/stdc++.h> ^ binary_tree.cpp: In function 'int main()': binary_tree.cpp:34:5: error: redefinition of 'int main()' int main() ^ binary_tree.cpp:11:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema binary_tree 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ă.