#541
Se dă lista muchiilor unui graf neorientat și trei vârfuri p q r . Să se determine un lanț cu extremitățile p q care conține vârful r.
| Problema | Lant1 | Operații I/O |
lant1.in/lant1.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #61821364 | Utilizator | |
| Fișier | lant1.cpp | Dimensiune | 1.24 KB |
| Data încărcării | 11 Decembrie 2025, 10:34 | Scor/rezultat | Eroare de compilare |
lant1.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream g("lant1.out") ^ lant1.cpp: In function 'int succ(int)': lant1.cpp:9:13: error: 'n' was not declared in this scope if(k<=2*n+1&&x[k]<n) ^ lant1.cpp:9:18: error: 'x' was not declared in this scope if(k<=2*n+1&&x[k]<n) ^ lant1.cpp: In function 'int valid(int)': lant1.cpp:21:8: error: 'x' was not declared in this scope if(x[1]!=p) ^ lant1.cpp:21:14: error: 'p' was not declared in this scope if(x[1]!=p) ^ lant1.cpp:24:12: error: 'x' was not declared in this scope if(x[i]==x[k]&&x[i-1]==x[k-1]||x[k-1]==x[i]&&x[i-1]==x[k]) ^ lant1.cpp:26:13: error: 'a' was not declared in this scope if(k>1&&a[x[k-1]][x[k]]==0) ^ lant1.cpp:26:15: error: 'x' was not declared in this scope if(k>1&&a[x[k-1]][x[k]]==0) ^ lant1.cpp: At global scope: lant1.cpp:32:5: error: expected primary-expression before 'int' int i,nr; ^ lant1.cpp:32:5: error: expected '}' before 'int' lant1.cpp:32:5: error: expected ',' or ';' before 'int' lant1.cpp:33:5: error: expected unqualified-id before 'for' for(i=1;i<=k;i++) ^ lant1.cpp:33:13: error: 'i' does not name a type for(i=1;i<=k;i++) ^ lant1.cpp:33:18: error: 'i' does not name a type for(i=1;i<=k;i++) ^ lant1.cpp:36:5: error: expected unqualified-id before 'if' if(nr>0&&x[k]==q) ^ lant1.cpp:38:5: error: expected unqualified-id before 'else' else ^ lant1.cpp:40:1: error: expected declaration before '}' token } ^ lant1.cpp: In function 'int succ(int)': lant1.cpp:17:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Lant1 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ă.