#414
Se dă lista muchiilor unui graf neorientat. Să se afișeze, pentru fiecare vârf al grafului, lista vecinilor săi.
| Problema | ListaVecini | Operații I/O |
listavecini.in/listavecini.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #60519727 | Utilizator | |
| Fișier | listavecini.cpp | Dimensiune | 572 B |
| Data încărcării | 04 Noiembrie 2025, 10:16 | Scor/rezultat | Eroare de compilare |
listavecini.cpp:4:1: error: expected ',' or ';' before 'ofstream' ofstream fout("listavecini.out") ^ listavecini.cpp: In function 'int main()': listavecini.cpp:8:10: error: 'n' was not declared in this scope fin>>n; ^ listavecini.cpp:9:16: error: 'x' was not declared in this scope while(fin>>x) ^ listavecini.cpp:11:14: error: 'y' was not declared in this scope fin>>y; ^ listavecini.cpp:12:9: error: 'v' was not declared in this scope v[x][y]=1; ^ listavecini.cpp:13:11: error: 't' was not declared in this scope v[t][x]=1; ^ listavecini.cpp:15:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ listavecini.cpp:17:9: error: 'k' was not declared in this scope k=0; ^ listavecini.cpp:18:13: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ listavecini.cpp:20:16: error: 'v' was not declared in this scope if(v[i][j]=1) ^ listavecini.cpp:25:9: error: 'fout' was not declared in this scope fout<<k<<" "; ^ listavecini.cpp:26:13: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ listavecini.cpp:28:16: error: 'v' was not declared in this scope if(v[i][j]==1) ^ listavecini.cpp:29:9: error: expected primary-expression before '}' token } ^ listavecini.cpp:29:9: error: expected ';' before '}' token
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ListaVecini 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ă.