#645
DetDrum3
Se dă vectorul de tați al unui arbore cu rădăcină cu n
noduri în care fiecare nod are asociată o valoare numerică. Determinați drumul de la rădăcină la un nod terminal pentru care suma valorilor asociate nodurilor este maximă.
Problema | DetDrum3 | Operații I/O |
detdrum3.in /detdrum3.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50262185 | Utilizator | |
Fișier | detdrum3.cpp | Dimensiune | 2.45 KB |
Data încărcării | 02 Aprilie 2024, 17:26 | Scor / rezultat | Eroare de compilare |
detdrum3.cpp:60:11: error: redefinition of 'std::ifstream f' ifstream f("detdrum3.in"); ^ detdrum3.cpp:4:10: error: 'std::ifstream f' previously declared here ifstream f("detdrum3.in"); ^ detdrum3.cpp:61:11: error: redefinition of 'std::ofstream g' ofstream g("detdrum3.out"); ^ detdrum3.cpp:5:10: error: 'std::ofstream g' previously declared here ofstream g("detdrum3.out"); ^ detdrum3.cpp:62:10: error: redefinition of 'int c [101]' int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:6:5: error: 'int c [101]' previously declared here int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:62:18: error: redefinition of 'int t [101]' int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:6:13: error: 'int t [101]' previously declared here int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:62:27: error: redefinition of 'int fr [101]' int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:6:21: error: 'int fr [101]' previously declared here int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:62:30: error: redefinition of 'int r' int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:6:30: error: 'int r' previously declared here int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:62:33: error: redefinition of 'int n' int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:6:33: error: 'int n' previously declared here int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:62:36: error: redefinition of 'int smax' int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:6:36: error: 'int smax' previously declared here int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:62:47: error: redefinition of 'int v [101]' int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:6:42: error: 'int v [101]' previously declared here int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:62:50: error: redefinition of 'int s' int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:6:50: error: 'int s' previously declared here int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:62:58: error: redefinition of 'int a [101]' int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:6:53: error: 'int a [101]' previously declared here int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:62:61: error: redefinition of 'int k' int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp:6:61: error: 'int k' previously declared here int c[101], t[101], fr[101], r, n, smax, v[101], s, a[101], k; ^ detdrum3.cpp: In function 'int main()': detdrum3.cpp:63:5: error: redefinition of 'int main()' int main() ^ detdrum3.cpp:7:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DetDrum3 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ă.