#673
DifSub
Se dă un arbore binar care conține valori numere naturale. Să se determine diferența în valoare absolută a sumei valorilor memorate în subarborele stâng al rădăcinii și suma valorilor memorate în subarborele drept al rădăcinii.
Problema | DifSub | Operații I/O |
difsub.in /difsub.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54914793 | Utilizator | |
Fișier | difsub.cpp | Dimensiune | 1.11 KB |
Data încărcării | 12 Decembrie 2024, 09:13 | Scor / rezultat | Eroare de compilare |
difsub.cpp:7:14: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin ("difsub.in"); ^ difsub.cpp:8:15: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout ("difsub.out"); ^ difsub.cpp: In function 'void solve()': difsub.cpp:30:5: error: reference to 'cin' is ambiguous cin>>n; ^ difsub.cpp:7:10: note: candidates are: <typeprefixerror>cin ifstream cin ("difsub.in"); ^ In file included from difsub.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ difsub.cpp:33:9: error: reference to 'cin' is ambiguous cin>>x[i]>>st[i]>>dr[i]; ^ difsub.cpp:7:10: note: candidates are: <typeprefixerror>cin ifstream cin ("difsub.in"); ^ In file included from difsub.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ difsub.cpp:48:5: error: reference to 'cout' is ambiguous cout<<abs(sumst-sumdr); ^ difsub.cpp:8:10: note: candidates are: <typeprefixerror>cout ofstream cout ("difsub.out"); ^ In file included from difsub.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ difsub.cpp: In function 'int main()': difsub.cpp:54:5: error: reference to 'cin' is ambiguous cin.tie(0); ^ difsub.cpp:7:10: note: candidates are: <typeprefixerror>cin ifstream cin ("difsub.in"); ^ In file included from difsub.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ difsub.cpp:55:5: error: reference to 'cout' is ambiguous cout.tie(0); ^ difsub.cpp:8:10: note: candidates are: <typeprefixerror>cout ofstream cout ("difsub.out"); ^ In file included from difsub.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 DifSub 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ă.