#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 | #54687484 | Utilizator | |
Fișier | hamilton.cpp | Dimensiune | 1.08 KB |
Data încărcării | 05 Decembrie 2024, 13:11 | Scor / rezultat | Eroare de compilare |
hamilton.cpp: In function 'int succesor(int)': hamilton.cpp:7:8: error: 'x' was not declared in this scope if(x[k]<n&&k<=m+1) ^ hamilton.cpp:7:13: error: 'n' was not declared in this scope if(x[k]<n&&k<=m+1) ^ hamilton.cpp:7:19: error: 'm' was not declared in this scope if(x[k]<n&&k<=m+1) ^ hamilton.cpp: In function 'int valid(int)': hamilton.cpp:16:13: error: 'a' was not declared in this scope if(k>1&&a[x[x[k]][x[k-1]]==0) ^ hamilton.cpp:16:15: error: 'x' was not declared in this scope if(k>1&&a[x[x[k]][x[k-1]]==0) ^ hamilton.cpp:16:33: error: expected ']' before ')' token if(k>1&&a[x[x[k]][x[k-1]]==0) ^ hamilton.cpp:18:9: error: 'i' was not declared in this scope for(i=1;i<k;i++) ^ hamilton.cpp:19:12: error: 'x' was not declared in this scope if(x[i]==x[k]) ^ hamilton.cpp: In function 'int sol(int)': hamilton.cpp:25:11: error: 'n' was not declared in this scope if(k==n&&a[x[1]][x[k]]==1) ^ hamilton.cpp:25:14: error: 'a' was not declared in this scope if(k==n&&a[x[1]][x[k]]==1) ^ hamilton.cpp:25:16: error: 'x' was not declared in this scope if(k==n&&a[x[1]][x[k]]==1) ^ hamilton.cpp: In function 'void afis(int)': hamilton.cpp:31:5: error: 'nr' was not declared in this scope nr=0; ^ hamilton.cpp:32:9: error: 'i' was not declared in this scope for(i=1;i<=k;i++) ^ hamilton.cpp:33:15: error: 'x' was not declared in this scope cout<<x[i]<<" "; ^ hamilton.cpp:34:11: error: 'x' was not declared in this scope cout<<x[1]<<endl; ^ hamilton.cpp: In function 'void back()': hamilton.cpp:40:5: error: 'x' was not declared in this scope x[k]=0; ^ hamilton.cpp:41:14: error: 'nr' was not declared in this scope while(k&&nr==1) ^ hamilton.cpp: In function 'int main()': hamilton.cpp:61:5: error: 'nr' was not declared in this scope nr=1; ^ hamilton.cpp:62:10: error: 'n' was not declared in this scope cin>>n; ^ hamilton.cpp:63:16: error: 'x' was not declared in this scope while(cin>>x>>y) ^ hamilton.cpp:63:19: error: 'y' was not declared in this scope while(cin>>x>>y) ^ hamilton.cpp:64:9: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^
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ă.