#437
Se dă lista muchiilor unui graf neorientat. Să se verifice dacă graful este sau nu conex.
| Problema | Conex | Operații I/O |
conex.in/conex.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #61385879 | Utilizator | |
| Fișier | conex.cpp | Dimensiune | 475 B |
| Data încărcării | 26 Noiembrie 2025, 11:33 | Scor/rezultat | Eroare de compilare |
conex.cpp:4:11: error: variable 'std::ifstream f' has initializer but incomplete type ifstream f("conex.in") ^ conex.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream g("conex.out") ^ conex.cpp: In function 'void dfs(int)': conex.cpp:9:9: error: expected unqualified-id before '[' token void[nod]=1; ^ conex.cpp:11:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ conex.cpp:12:15: error: 'ond' was not declared in this scope int(a[ond][i]==1&&viz[i]==0) ^ conex.cpp:12:13: error: 'a' was not declared in this scope int(a[ond][i]==1&&viz[i]==0) ^ conex.cpp:12:27: error: 'viz' was not declared in this scope int(a[ond][i]==1&&viz[i]==0) ^ conex.cpp:13:9: error: expected ';' before 'dfs' dfs[i]; ^ conex.cpp: In function 'int main()': conex.cpp:17:8: error: 'n' was not declared in this scope f>>n; ^ conex.cpp:18:14: error: 'x' was not declared in this scope while(f>>x>>y) ^ conex.cpp:18:17: error: 'y' was not declared in this scope while(f>>x>>y) ^ conex.cpp:19:9: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ conex.cpp:22:12: error: 'viz' was not declared in this scope if(viz[i]==0) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Conex 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ă.