#4061
LantQ
Se dă un graf neorientat cu n vârfuri și un număr natural q
. Să se determine toate lanțurile elementare formate din cel puțin o muchie, cu extremitatea finală în vârful q
.
Problema | LantQ | Operații I/O |
![]() lantq.in /lantq.out
|
---|---|---|---|
Limita timp | 0.4 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58029194 | Utilizator | |
Fișier | lantq.cpp | Dimensiune | 705 B |
Data încărcării | 09 Mai 2025, 11:43 | Scor / rezultat | Eroare de compilare |
lantq.cpp:5:15: error: expected initializer before 'n' int a[21][21] n, m, q, x[21], ok=0, fr[21]; ^ lantq.cpp: In function 'void afisare(int)': lantq.cpp:8:31: error: 'x' was not declared in this scope {for(int i=1; i<=k; i++)fout<<x[i]<<" "; ^ lantq.cpp: In function 'int valid(int)': lantq.cpp:17:12: error: 'a' was not declared in this scope if(a[x[k]][x[k-1]]==0)return 0; ^ lantq.cpp:17:14: error: 'x' was not declared in this scope if(a[x[k]][x[k-1]]==0)return 0; ^ lantq.cpp: In function 'void bkt(int)': lantq.cpp:22:18: error: 'n' was not declared in this scope { for(int i=1;i<=n;i++) ^ lantq.cpp:23:8: error: 'fr' was not declared in this scope if(fr[i]==0) ^ lantq.cpp:24:6: error: 'x' was not declared in this scope { x[k]=i; ^ lantq.cpp:26:18: error: 'q' was not declared in this scope if(x[k]==q){if(k>=2)afisare(k); ok=1;} ^ lantq.cpp:26:41: error: 'ok' was not declared in this scope if(x[k]==q){if(k>=2)afisare(k); ok=1;} ^ lantq.cpp:25:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(valid(k)) ^ lantq.cpp: In function 'int main()': lantq.cpp:32:8: error: 'n' was not declared in this scope { fin>>n>>m; ^ lantq.cpp:32:11: error: 'm' was not declared in this scope { fin>>n>>m; ^ lantq.cpp:35:11: error: 'a' was not declared in this scope a[i][j]=a[j][i]=1; ^ lantq.cpp:38:7: error: 'q' was not declared in this scope fin>>q; ^ lantq.cpp:40:2: error: expected ';' before 'if' if(ok==0)fout<<"NU EXISTA"; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LantQ 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ă.