#579
Drum Hamiltonian
Se dă un graf orientat cu n
noduri. Determinați, dacă există, un drum hamiltonian.
Problema | Drum Hamiltonian | Operații I/O |
![]() drum_hamiltonian.in /drum_hamiltonian.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58145823 | Utilizator | |
Fișier | drum_hamiltonian.cpp | Dimensiune | 883 B |
Data încărcării | 16 Mai 2025, 11:23 | Scor / rezultat | Eroare de compilare |
drum_hamiltonian.cpp:3:1: error: 'usingnamespace' does not name a type usingnamespace std; ^ drum_hamiltonian.cpp:4:1: error: 'ifstream' does not name a type ifstream f ("drum_hamiltonian.in"); ^ drum_hamiltonian.cpp:5:1: error: 'ofstream' does not name a type ofstream g ("drum_hamiltonian.out"); ^ drum_hamiltonian.cpp: In function 'void afis(int)': drum_hamiltonian.cpp:8:17: warning: left operand of comma operator has no effect [-Wunused-value] { for (int i=1;i<=k,i++) cout<<x[i]<<" "; ^ drum_hamiltonian.cpp:8:24: error: expected ';' before ')' token { for (int i=1;i<=k,i++) cout<<x[i]<<" "; ^ drum_hamiltonian.cpp:8:26: error: 'cout' was not declared in this scope { for (int i=1;i<=k,i++) cout<<x[i]<<" "; ^ drum_hamiltonian.cpp:8:26: note: suggested alternative: In file included from drum_hamiltonian.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ drum_hamiltonian.cpp:9:2: error: 'cout' was not declared in this scope cout<<"\n"; ^ drum_hamiltonian.cpp:9:2: note: suggested alternative: In file included from drum_hamiltonian.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ drum_hamiltonian.cpp: In function 'int valid(int)': drum_hamiltonian.cpp:12:31: error: expected ']' before ')' token { if(k>=2)if(a[x[k-1]][x[k]==0)return 0; ^ drum_hamiltonian.cpp: In function 'void bkt(int)': drum_hamiltonian.cpp:16:23: error: unable to find numeric literal operator 'operator"" k' {for (int i=1;i<=n && 0k==0;i++) ^ drum_hamiltonian.cpp:17:28: error: expected '}' before ';' token if( fr[i]==0)ok={x[k]=1; ^ drum_hamiltonian.cpp:18:25: error: 'i' was not declared in this scope fr[i]=1; ^ drum_hamiltonian.cpp:19:37: error: expected ')' before 'if' if ( valid((k))if(k==n)ok=1; ^ drum_hamiltonian.cpp: In function 'int main()': drum_hamiltonian.cpp:25:6: error: 'f' was not declared in this scope f>>n; ^ drum_hamiltonian.cpp:29:16: error: 'g' was not declared in this scope if(ok==1){g<<1; ^ drum_hamiltonian.cpp:34:15: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Drum Hamiltonian 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ă.