#4155
Harta3
Harta unei regiuni este reprezentată într-un sistem de coordonate cartezian și sunt cunoscute coordonatele a n
orașe, numerotate de la 1
la n
.
Se dorește construirea unor drumuri bidirecționale între anumite perechi de orașe, astfel încât:
Să se determine suma lungimilor drumurilor construite.
Problema | Harta3 | Operații I/O |
harta3.in /harta3.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50305196 | Utilizator | |
Fișier | harta3.cpp | Dimensiune | 2.22 KB |
Data încărcării | 03 Aprilie 2024, 22:37 | Scor / rezultat | Eroare de compilare |
harta3.cpp:9:1: error: 'ifstream' does not name a type ifstream fin("harta3.in"); ^ harta3.cpp:10:1: error: 'ofstream' does not name a type ofstream fout("harta3.out"); ^ harta3.cpp: In function 'int main()': harta3.cpp:17:5: error: 'fin' was not declared in this scope fin >> n; ^ harta3.cpp:35:33: error: 'swap' was not declared in this scope swap(M[i] , M[j]); ^ harta3.cpp:35:33: note: suggested alternatives: In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from harta3.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:2717:5: note: 'std::swap' swap(basic_string<_CharT, _Traits, _Alloc>& __lhs, ^ In file included from /usr/include/c++/4.8/exception:152:0, from /usr/include/c++/4.8/ios:39, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from harta3.cpp:1: /usr/include/c++/4.8/bits/exception_ptr.h:160:5: note: 'std::__exception_ptr::swap' swap(exception_ptr& __lhs, exception_ptr& __rhs) ^ harta3.cpp:47:9: error: 'cout' was not declared in this scope cout << M[i].i << " " << M[i].j << " " << M[i].cost << endl; // Afișăm muchia adăugată în arborele de acoperire minim ^ harta3.cpp:47:9: note: suggested alternative: In file included from harta3.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ harta3.cpp:47:64: error: 'endl' was not declared in this scope cout << M[i].i << " " << M[i].j << " " << M[i].cost << endl; // Afișăm muchia adăugată în arborele de acoperire minim ^ harta3.cpp:47:64: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from harta3.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ harta3.cpp:58:5: error: 'fout' was not declared in this scope fout << setprecision(4) << fixed << S << endl; ^ harta3.cpp:58:27: error: 'setprecision' was not declared in this scope fout << setprecision(4) << fixed << S << endl; ^ harta3.cpp:58:27: note: suggested alternative: In file included from harta3.cpp:3:0: /usr/include/c++/4.8/iomanip:192:3: note: 'std::setprecision' setprecision(int __n) ^ harta3.cpp:58:32: error: 'fixed' was not declared in this scope fout << setprecision(4) << fixed << S << endl; ^ harta3.cpp:58:32: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from harta3.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:964:3: note: 'std::fixed' fixed(ios_base& __base) ^ harta3.cpp:58:46: error: 'endl' was not declared in this scope fout << setprecision(4) << fixed << S << endl; ^ harta3.cpp:58:46: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from harta3.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Harta3 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ă.