#475
Lant
Se dă lista muchiilor unui graf neorientat cu n
vârfuri și două vârfuri p q
. Să se determine toate lanțurile elementare cu extremitățile p
și q
.
Problema | Lant | Operații I/O |
lant.in /lant.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #11770461 | Utilizator | |
Fișier | lant.cpp | Dimensiune | 627 B |
Data încărcării | 09 Noiembrie 2018, 09:36 | Scor / rezultat | Eroare de compilare |
lant.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream g("lant.out") ^ lant.cpp: In function 'void afis(int)': lant.cpp:10:11: error: 'g' was not declared in this scope cout<<g[i]<<" "; ^ lant.cpp:11:5: error: 'g' was not declared in this scope g<<endl;} ^ lant.cpp: In function 'int ok(int)': lant.cpp:14:14: warning: right operand of comma operator has no effect [-Wunused-value] for(i=1,i<=k-1;i++) ^ lant.cpp:14:23: error: expected ';' before ')' token for(i=1,i<=k-1;i++) ^ lant.cpp:15:4: error: 'sol' was not declared in this scope if(sol[k]==sol[i]) ^ lant.cpp:16:8: error: 'a' was not declared in this scope if(a[sol[k]][sol[k-1]]==0) ^ lant.cpp: In function 'void back(int)': lant.cpp:21:12: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ lant.cpp:22:3: error: 'sol' was not declared in this scope {sol[k]=i; ^ lant.cpp:24:16: error: 'q' was not declared in this scope if(sol[k]==q) ^ lant.cpp:26:5: error: expected ';' before 'else' else ^ lant.cpp: In function 'int main()': lant.cpp:32:12: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ lant.cpp:33:5: error: 'x' was not declared in this scope {f>>x>>y; ^ lant.cpp:33:8: error: 'y' was not declared in this scope {f>>x>>y; ^ lant.cpp:34:1: error: 'a' was not declared in this scope a[x][y]=1; ^ lant.cpp:37:7: error: 'p' was not declared in this scope f>>p>>q; ^ lant.cpp:37:10: error: 'q' was not declared in this scope f>>p>>q; ^ lant.cpp:38:4: error: 'sol' was not declared in this scope sol[1]=p; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Lant 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ă.