#438
ComponenteConexe
Se dă lista muchiilor unui graf neorientat. Să se afișeze componentele conexe ale acestui graf.
Problema | ComponenteConexe | Operații I/O |
componenteconexe.in /componenteconexe.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52104463 | Utilizator | |
Fișier | componenteconexe.cpp | Dimensiune | 729 B |
Data încărcării | 19 Septembrie 2024, 09:48 | Scor / rezultat | Eroare de compilare |
componenteconexe.cpp:4:1: error: expected ',' or ';' before 'ofstream' ofstream fout("componenteconexe.out") ^ componenteconexe.cpp: In function 'void citire()': componenteconexe.cpp:9:10: error: 'n' was not declared in this scope fin>>n; ^ componenteconexe.cpp:12:9: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ componenteconexe.cpp: In function 'void DFS(int)': componenteconexe.cpp:16:5: error: 'viz' was not declared in this scope viz[x]=nrcc; ^ componenteconexe.cpp:16:12: error: 'nrcc' was not declared in this scope viz[x]=nrcc; ^ componenteconexe.cpp:17:21: error: 'n' was not declared in this scope for(int i=1; i<=n; ++i) ^ componenteconexe.cpp:18:12: error: 'a' was not declared in this scope if(a[x][i] && !viz[i]) ^ componenteconexe.cpp: In function 'void afisare()': componenteconexe.cpp:23:5: error: 'fout' was not declared in this scope fout<<nrcc<<'\n'; ^ componenteconexe.cpp:23:11: error: 'nrcc' was not declared in this scope fout<<nrcc<<'\n'; ^ componenteconexe.cpp:25:25: error: 'n' was not declared in this scope for(int j=1; j<=n; ++j) ^ componenteconexe.cpp:26:16: error: 'viz' was not declared in this scope if(viz[j]==i) ^ componenteconexe.cpp: In function 'int main()': componenteconexe.cpp:33:21: error: 'n' was not declared in this scope for(int i=1; i<=n; ++i) ^ componenteconexe.cpp:34:9: error: 'viz' was not declared in this scope if(!viz[i]){ ^ componenteconexe.cpp:35:9: error: 'nrcc' was not declared in this scope nrcc++; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe 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ă.