#438
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 | #56607715 | Utilizator | |
Fișier | componenteconexe.cpp | Dimensiune | 656 B |
Data încărcării | 27 Februarie 2025, 10:18 | Scor / rezultat | Eroare de compilare |
componenteconexe.cpp:7:15: error: two or more data types in declaration of 'DFS' void DFS(int x) ^ componenteconexe.cpp: In function 'int main()': componenteconexe.cpp:17:10: error: 'n' was not declared in this scope fin>>n; ^ componenteconexe.cpp:18:16: error: 'x' was not declared in this scope while(fin>>x>>y); ^ componenteconexe.cpp:18:19: error: 'y' was not declared in this scope while(fin>>x>>y); ^ componenteconexe.cpp:20:9: error: 'a' was not declared in this scope a[x][y]=1; ^ componenteconexe.cpp:20:11: error: 'x' was not declared in this scope a[x][y]=1; ^ componenteconexe.cpp:20:14: error: 'y' was not declared in this scope a[x][y]=1; ^ componenteconexe.cpp:23:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ componenteconexe.cpp:24:12: error: 'viz' was not declared in this scope if(viz[i]==0) ^ componenteconexe.cpp:26:9: error: 'nrc' was not declared in this scope nrc++; ^ componenteconexe.cpp:27:14: error: 'DFS' was not declared in this scope DFS(i); ^ componenteconexe.cpp:29:11: error: 'nrc' was not declared in this scope fout<<nrc<<'\n'; ^ componenteconexe.cpp:30:9: error: 'i' was not declared in this scope for(i=1;i<=nrc;i++) ^ componenteconexe.cpp:32:13: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ componenteconexe.cpp:33:16: error: 'viz' was not declared in this scope if(viz[j]==i) ^
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ă.