#548
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 | #64111186 | Utilizator | |
| Fișier | hamilton.cpp | Dimensiune | 1.11 KB |
| Data încărcării | 17 Aprilie 2026, 14:16 | Scor/rezultat | Eroare de compilare |
hamilton.cpp: In function ‘int valid(int)’: hamilton.cpp:22:16: error: invalid types ‘int[int]’ for array subscript 22 | if(a[x[k-1][x[k]]==0) | ^ hamilton.cpp:22:25: error: expected ‘]’ before ‘)’ token 22 | if(a[x[k-1][x[k]]==0) | ^ | ] hamilton.cpp: In function ‘void afis(int)’: hamilton.cpp:35:10: error: expected ‘;’ before ‘for’ 35 | nrs++ | ^ | ; 36 | for(i=1;i<=k;i++) | ~~~ hamilton.cpp:36:18: warning: statement has no effect [-Wunused-value] 36 | for(i=1;i<=k;i++) | ~^~~ hamilton.cpp:36:25: error: expected ‘;’ before ‘)’ token 36 | for(i=1;i<=k;i++) | ^ | ; hamilton.cpp: In function ‘void back()’: hamilton.cpp:62:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 62 | int main() | ^~ hamilton.cpp:62:9: note: remove parentheses to default-initialize a variable 62 | int main() | ^~ | -- hamilton.cpp:62:9: note: or replace parentheses with braces to value-initialize a variable hamilton.cpp:63:1: error: a function-definition is not allowed here before ‘{’ token 63 | { | ^ hamilton.cpp:72:2: error: expected ‘}’ at end of input 72 | } | ^ hamilton.cpp:49:3: note: to match this ‘{’ 49 | { | ^ hamilton.cpp:72:2: error: expected ‘}’ at end of input 72 | } | ^ hamilton.cpp:43:1: note: to match this ‘{’ 43 | { | ^
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ă.