#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 | #48577613 | Utilizator | |
Fișier | hamilton.cpp | Dimensiune | 862 B |
Data încărcării | 30 Ianuarie 2024, 09:48 | Scor / rezultat | Eroare de compilare |
hamilton.cpp: In function 'void output()': hamilton.cpp:12:5: error: reference to 'cout' is ambiguous cout<<1<<'\n'; ^ hamilton.cpp:5:10: 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:9: error: reference to 'cout' is ambiguous cout<<st[i]<<" "; ^ hamilton.cpp:5:10: 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:16:5: error: reference to 'cout' is ambiguous cout<<1; ^ hamilton.cpp:5:10: 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 bk(int)': hamilton.cpp:34:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ hamilton.cpp: In function 'int main()': hamilton.cpp:37:5: error: reference to 'cin' is ambiguous cin>>n; ^ hamilton.cpp:4:10: 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:39:11: error: reference to 'cin' is ambiguous while(cin>>f1>>f2){ ^ hamilton.cpp:4:10: 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:46:9: error: reference to 'cout' is ambiguous cout<<'0'; ^ hamilton.cpp:5:10: 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ă.