#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 | #54840158 | Utilizator | |
Fișier | lantq.cpp | Dimensiune | 636 B |
Data încărcării | 10 Decembrie 2024, 09:04 | Scor / rezultat | Eroare de compilare |
lantq.cpp: In function 'void dfs(int)': lantq.cpp:3:5: error: 'viz' was not declared in this scope viz[nod]=1; ^ lantq.cpp:4:5: error: 'v' was not declared in this scope v[++k]=nod; ^ lantq.cpp:4:9: error: 'k' was not declared in this scope v[++k]=nod; ^ lantq.cpp:5:13: error: 'q' was not declared in this scope if(nod==q) ^ lantq.cpp:6:14: error: 'ok' was not declared in this scope { ok=1; ^ lantq.cpp:8:22: error: 'cout' was not declared in this scope { cout<<v[i]<<" "; ^ lantq.cpp:9:18: error: 'cout' was not declared in this scope } cout<<'\n'; ^ lantq.cpp:10:43: error: 'n' was not declared in this scope } else { for(int i=1; i<=n; i++) ^ lantq.cpp:11:29: error: 'mat' was not declared in this scope if(viz[i]==0 && mat[nod][i]) ^ lantq.cpp: In function 'int main()': lantq.cpp:18:5: error: 'cin' was not declared in this scope cin>>n>>m; ^ lantq.cpp:18:10: error: 'n' was not declared in this scope cin>>n>>m; ^ lantq.cpp:21:9: error: 'mat' was not declared in this scope mat[x][y]=1; ^ lantq.cpp:23:15: error: 'q' was not declared in this scope } cin>>q; ^ lantq.cpp:28:8: error: 'ok' was not declared in this scope if(ok==0) ^ lantq.cpp:29:9: error: 'cout' was not declared in this scope cout << "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ă.