#476
Se dă lista muchiilor unui graf neorientat cu n vârfuri și trei vârfuri p q r. Să se determine toate lanțurile elementare cu extremitățile în p și q care conțin vârful r.
| Problema | Lanturi | Operații I/O |
lanturi.in/lanturi.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #61558388 | Utilizator | |
| Fișier | lanturi.cpp | Dimensiune | 963 B |
| Data încărcării | 02 Decembrie 2025, 16:47 | Scor/rezultat | Eroare de compilare |
lanturi.cpp: In function 'int validare(int)': lanturi.cpp:12:27: error: invalid types 'int [101][101][int [101]]' for array subscript return (a[st[k-1]][st[k]]); ^ lanturi.cpp: In function 'int verificare(int)': lanturi.cpp:17:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(st[k]==1)return 1; ^ lanturi.cpp: In function 'int main()': lanturi.cpp:30:10: error: incompatible types in assignment of 'int' to 'int [101]' st[k]=0; ^ lanturi.cpp:34:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] while(ok==0 and st[k]+1<=n) ^ lanturi.cpp:36:18: error: lvalue required as increment operand st[k]++; ^ lanturi.cpp:40:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(st[k]==q and validare(k)==1) ^ lanturi.cpp:46:21: error: incompatible types in assignment of 'int' to 'int [101]' else st[++k]=0; ^ lanturi.cpp: In function 'int validare(int)': lanturi.cpp:13:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Lanturi 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ă.