#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 | #51143027 | Utilizator | |
Fișier | drum_hamiltonian.cpp | Dimensiune | 799 B |
Data încărcării | 27 Mai 2024, 01:18 | Scor / rezultat | Eroare de compilare |
drum_hamiltonian.cpp:6:15: warning: missing terminating " character [enabled by default] ofstream fout("drum_hamiltonian.out); ^ drum_hamiltonian.cpp:6:1: error: missing terminating " character ofstream fout("drum_hamiltonian.out); ^ drum_hamiltonian.cpp:7:7: error: 'M' has not been declared int n,M[11][11],ok,m,k,i,sol[11],j; ^ drum_hamiltonian.cpp:7:17: error: 'ok' has not been declared int n,M[11][11],ok,m,k,i,sol[11],j; ^ drum_hamiltonian.cpp:7:20: error: 'm' has not been declared int n,M[11][11],ok,m,k,i,sol[11],j; ^ drum_hamiltonian.cpp:7:22: error: 'k' has not been declared int n,M[11][11],ok,m,k,i,sol[11],j; ^ drum_hamiltonian.cpp:7:24: error: 'i' has not been declared int n,M[11][11],ok,m,k,i,sol[11],j; ^ drum_hamiltonian.cpp:7:26: error: 'sol' has not been declared int n,M[11][11],ok,m,k,i,sol[11],j; ^ drum_hamiltonian.cpp:7:34: error: 'j' has not been declared int n,M[11][11],ok,m,k,i,sol[11],j; ^ drum_hamiltonian.cpp:7:35: error: expected ')' before ';' token int n,M[11][11],ok,m,k,i,sol[11],j; ^ drum_hamiltonian.cpp: In function 'void afisare()': drum_hamiltonian.cpp:11:7: error: 'i' was not declared in this scope for(i = 1; i<= n; i++) ^ drum_hamiltonian.cpp:11:18: error: 'n' was not declared in this scope for(i = 1; i<= n; i++) ^ drum_hamiltonian.cpp:12:11: error: 'sol' was not declared in this scope fout<<sol[i]<<" "; ^ drum_hamiltonian.cpp:13:9: error: invalid operands of types 'std::ofstream(int, int (*)[11], int, int, int, int, int*, int) {aka std::basic_ofstream<char>(int, int (*)[11], int, int, int, int, int*, int)}' and '<unresolved overloaded function type>' to binary 'operator<<' fout<<endl; ^ drum_hamiltonian.cpp:14:3: error: 'ok' was not declared in this scope ok=1; ^ drum_hamiltonian.cpp: In function 'int OK(int, int)': drum_hamiltonian.cpp:18:7: error: 'i' was not declared in this scope for(i = 1; i< k; i++) ^ drum_hamiltonian.cpp:19:8: error: 'sol' was not declared in this scope if(sol[i]==x) ^ drum_hamiltonian.cpp:22:6: error: 'M' was not declared in this scope if(M[sol[k-1]][x]==0 ) ^ drum_hamiltonian.cpp:22:8: error: 'sol' was not declared in this scope if(M[sol[k-1]][x]==0 ) ^ drum_hamiltonian.cpp: In function 'void bkt(int)': drum_hamiltonian.cpp:30:16: error: 'n' was not declared in this scope for(x=1; x<= n; x++) ^ drum_hamiltonian.cpp:31:20: error: 'M' was not declared in this scope if((p[x]==0 && M[sol[k-1]][x]==1 && ok==0) || k==1) ^ drum_hamiltonian.cpp:31:22: error: 'sol' was not declared in this scope if((p[x]==0 && M[sol[k-1]][x]==1 && ok==0) || k==1) ^ drum_hamiltonian.cpp:31:41: error: 'ok' was not declared in this scope if((p[x]==0 && M[sol[k-1]][x]==1 && ok==0) || k==1) ^ drum_hamiltonian.cpp: In function 'int main()': drum_hamiltonian.cpp:45:8: error: 'n' was not declared in this scope fin>>n; ^ drum_hamiltonian.cpp:46:14: error: 'i' was not declared in this scope while(fin>>i>>j) ^ drum_hamiltonian.cpp:46:17: error: 'j' was not declared in this scope while(fin>>i>>j) ^ drum_hamiltonian.cpp:47:6: error: 'M' was not declared in this scope M[i][j]=1; ^
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ă.