#646
Se dă vectorul de tați al unui arbore cu rădăcină cu n
noduri și un nod k
. Afișați, în ordine crescătoare, nodurile terminale din subarborele cu rădăcina în k
.
Problema | Subarbore1 | Operații I/O |
![]() subarbore1.in /subarbore1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57706530 | Utilizator | |
Fișier | subarbore1.cpp | Dimensiune | 1.91 KB |
Data încărcării | 11 Aprilie 2025, 10:44 | Scor / rezultat | Eroare de compilare |
subarbore1.cpp: In function 'int main()': subarbore1.cpp:41:9: warning: variable 'r' set but not used [-Wunused-but-set-variable] int r,aux; ^ subarbore1.cpp: At global scope: subarbore1.cpp:70:11: error: redefinition of 'std::ifstream f' ifstream f("subarbore1.in"); ^ subarbore1.cpp:4:10: error: 'std::ifstream f' previously declared here ifstream f("subarbore1.in"); ^ subarbore1.cpp:71:11: error: redefinition of 'std::ofstream g' ofstream g("subarbore1.out"); ^ subarbore1.cpp:5:10: error: 'std::ofstream g' previously declared here ofstream g("subarbore1.out"); ^ subarbore1.cpp:72:5: error: redefinition of 'int n' int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:6:5: error: 'int n' previously declared here int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:72:7: error: redefinition of 'int k' int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:6:7: error: 'int k' previously declared here int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:72:14: error: redefinition of 'int t [101]' int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:6:9: error: 'int t [101]' previously declared here int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:72:21: error: redefinition of 'int c [101]' int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:6:16: error: 'int c [101]' previously declared here int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:72:29: error: redefinition of 'int nv [101]' int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:6:23: error: 'int nv [101]' previously declared here int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:72:31: error: redefinition of 'int st' int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:6:31: error: 'int st' previously declared here int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:72:34: error: redefinition of 'int dr' int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:6:34: error: 'int dr' previously declared here int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:72:37: error: redefinition of 'int nr' int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:6:37: error: 'int nr' previously declared here int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:72:46: error: redefinition of 'int v [1001]' int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:6:40: error: 'int v [1001]' previously declared here int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:72:48: error: redefinition of 'int nr1' int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:6:48: error: 'int nr1' previously defined here int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:72:54: error: redefinition of 'int i' int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:6:54: error: 'int i' previously declared here int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:72:56: error: redefinition of 'int j' int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp:6:56: error: 'int j' previously declared here int n,k,t[101],c[101],nv[101],st,dr,nr,v[1001],nr1=0,i,j; ^ subarbore1.cpp: In function 'void bf(int)': subarbore1.cpp:73:6: error: redefinition of 'void bf(int)' void bf(int start) ^ subarbore1.cpp:7:6: error: 'void bf(int)' previously defined here void bf(int start) ^ subarbore1.cpp: In function 'int main()': subarbore1.cpp:105:5: error: redefinition of 'int main()' int main() ^ subarbore1.cpp:39:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Subarbore1 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ă.