#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 | #54999115 | Utilizator | |
Fișier | hamilton.cpp | Dimensiune | 799 B |
Data încărcării | 15 Decembrie 2024, 21:06 | Scor / rezultat | Eroare de compilare |
hamilton.cpp: In function 'void afisare()': hamilton.cpp:8:6: error: reference to 'cout' is ambiguous cout << 1 << '\n'; ^ hamilton.cpp:4: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:10:9: error: reference to 'cout' is ambiguous cout << x[i] << " "; ^ hamilton.cpp:4: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:11:5: error: reference to 'cout' is ambiguous cout << x[1]; ^ hamilton.cpp:4: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:31:5: error: reference to 'cin' is ambiguous cin >> n; ^ hamilton.cpp:3: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:32:11: error: reference to 'cin' is ambiguous while(cin >> x1 >> y) ^ hamilton.cpp:3: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:35:17: error: reference to 'cout' is ambiguous if(ok == 0) cout << 0; ^ hamilton.cpp:4: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ă.