#548
Hamilton
Se dă un graf neorientat cu n
vârfuri. Determinați, dacă există, un ciclu hamiltonian.
Problema | Hamilton | Operații I/O |
![]() hamilton.in /hamilton.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #48754581 | Utilizator | |
Fișier | hamilton.cpp | Dimensiune | 811 B |
Data încărcării | 04 Februarie 2024, 17:01 | Scor / rezultat | Eroare de compilare |
hamilton.cpp: In function 'void afisare()': hamilton.cpp:11:6: error: reference to 'cout' is ambiguous cout << 1 << '\n'; ^ hamilton.cpp:5:11: note: candidates are: std::ofstream cout ofstream cout("hamilton.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from hamilton.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ hamilton.cpp:13:9: error: reference to 'cout' is ambiguous cout << x[i] << " "; ^ hamilton.cpp:5:11: note: candidates are: std::ofstream cout ofstream cout("hamilton.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from hamilton.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ hamilton.cpp:14:5: error: reference to 'cout' is ambiguous cout << x[1]; ^ hamilton.cpp:5:11: note: candidates are: std::ofstream cout ofstream cout("hamilton.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from hamilton.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ hamilton.cpp: In function 'int main()': hamilton.cpp:36:5: error: reference to 'cin' is ambiguous cin >> n; ^ hamilton.cpp:4:11: note: candidates are: std::ifstream cin ifstream cin("hamilton.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from hamilton.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ hamilton.cpp:37:11: error: reference to 'cin' is ambiguous while(cin >> x1 >> y) ^ hamilton.cpp:4:11: note: candidates are: std::ifstream cin ifstream cin("hamilton.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from hamilton.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ hamilton.cpp:41:17: error: reference to 'cout' is ambiguous if(ok == 0) cout << 0; ^ hamilton.cpp:5:11: note: candidates are: std::ofstream cout ofstream cout("hamilton.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from hamilton.cpp:1: /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 Hamilton 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ă.