#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 | #64261930 | Utilizator | |
| Fișier | listavecini.cpp | Dimensiune | 391 B |
| Data încărcării | 27 Aprilie 2026, 08:09 | Scor/rezultat | Eroare de compilare |
listavecini.cpp:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include | ^ listavecini.cpp:3:15: error: extended character “ is not valid in an identifier 3 | ifstream fin (“listavecini.in”); | ^ listavecini.cpp:3:28: error: extended character ” is not valid in an identifier 3 | ifstream fin (“listavecini.in”); | ^ listavecini.cpp:4:16: error: extended character “ is not valid in an identifier 4 | ofstream fout (“listavecini.out”); | ^ listavecini.cpp:4:29: error: extended character ” is not valid in an identifier 4 | ofstream fout (“listavecini.out”); | ^ listavecini.cpp:14:12: error: extended character ” is not valid in an identifier 14 | fout<<cnt<<” “; | ^ listavecini.cpp:14:14: error: extended character “ is not valid in an identifier 14 | fout<<cnt<<” “; | ^ listavecini.cpp:16:22: error: extended character ” is not valid in an identifier 16 | if(a[i][j]) fout<<j<<” “; | ^ listavecini.cpp:16:24: error: extended character “ is not valid in an identifier 16 | if(a[i][j]) fout<<j<<” “; | ^ listavecini.cpp:3:1: error: ‘ifstream’ does not name a type 3 | ifstream fin (“listavecini.in”); | ^~~~~~~~ listavecini.cpp:4:1: error: ‘ofstream’ does not name a type 4 | ofstream fout (“listavecini.out”); | ^~~~~~~~ listavecini.cpp: In function ‘int main()’: listavecini.cpp:7:3: error: ‘fin’ was not declared in this scope 7 | { fin>>n; while(fin>>x>>y) | ^~~ listavecini.cpp:8:1: error: ‘a’ was not declared in this scope 8 | a[x][y]=a[y][x] | ^ listavecini.cpp:13:4: error: ‘a’ was not declared in this scope 13 | if(a[i][j]) cnt++; | ^ listavecini.cpp:14:1: error: ‘fout’ was not declared in this scope 14 | fout<<cnt<<” “; | ^~~~ listavecini.cpp:14:12: error: ‘”’ was not declared in this scope 14 | fout<<cnt<<” “; | ^ listavecini.cpp:16:4: error: ‘a’ was not declared in this scope 16 | if(a[i][j]) fout<<j<<” “; | ^ listavecini.cpp:17:7: error: ‘endl’ was not declared in this scope 17 | fout<<endl; } return 0; | ^~~~ listavecini.cpp:1:1: note: ‘std::endl’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’? +++ |+#include <ostream> 1 | #include
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ă.