#474
Se dă lista muchiilor unui graf neorientat cu n vârfuri și o succesiune de k vârfuri. Să se verifice dacă vârfurile din succesiune formează un lanț.
| Problema | VerifLant | Operații I/O |
veriflant.in/veriflant.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64936683 | Utilizator | |
| Fișier | veriflant.cpp | Dimensiune | 1.02 KB |
| Data încărcării | 17 Iunie 2026, 09:44 | Scor/rezultat | Eroare de compilare |
veriflant.cpp:7:5: error: conflicting declaration ‘int x [105]’ 7 | int x[105]; | ^ veriflant.cpp:5:16: note: previous declaration as ‘int x’ 5 | int n, m, k, p,x,y; | ^ veriflant.cpp: In function ‘int main()’: veriflant.cpp:13:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 13 | for (int i = 1; i <= m; i++) | ^~~ veriflant.cpp:16:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 16 | a[x][y] =a[y][x] = 1; | ^ veriflant.cpp:16:9: error: ‘a’ was not declared in this scope veriflant.cpp: At global scope: veriflant.cpp:19:5: error: ‘cin’ does not name a type 19 | cin >> k; | ^~~ veriflant.cpp:20:5: error: expected unqualified-id before ‘for’ 20 | for (int i = 1; i <= k; i++) | ^~~ veriflant.cpp:20:21: error: ‘i’ does not name a type 20 | for (int i = 1; i <= k; i++) | ^ veriflant.cpp:20:29: error: ‘i’ does not name a type 20 | for (int i = 1; i <= k; i++) | ^ veriflant.cpp:27:5: error: expected unqualified-id before ‘for’ 27 | for (int j = 1; j < p; j++) | ^~~ veriflant.cpp:27:21: error: ‘j’ does not name a type 27 | for (int j = 1; j < p; j++) | ^ veriflant.cpp:27:28: error: ‘j’ does not name a type 27 | for (int j = 1; j < p; j++) | ^ veriflant.cpp:31:6: error: expected unqualified-id before ‘if’ 31 | if (ok == 0) | ^~ veriflant.cpp:33:6: error: expected unqualified-id before ‘else’ 33 | else | ^~~~ veriflant.cpp:53:5: error: expected unqualified-id before ‘return’ 53 | return 0; | ^~~~~~ veriflant.cpp:54:1: error: expected declaration before ‘}’ token 54 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema VerifLant 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ă.