#4073
ComponenteConexe5
Se dă lista muchiilor unui graf neorientat cu n
noduri și m
muchii și un șir de q
noduri. Să se determine pentru fiecare nod x
din șir numărul de noduri din componenta conexă din care face parte x
.
Problema | ComponenteConexe5 | Operații I/O |
componenteconexe5.in /componenteconexe5.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50486961 | Utilizator | |
Fișier | componenteconexe5.cpp | Dimensiune | 825 B |
Data încărcării | 11 Aprilie 2024, 11:40 | Scor / rezultat | Eroare de compilare |
componenteconexe5.cpp: In function 'void bfs(int)': componenteconexe5.cpp:10:22: error: storage size of 'coada' isn't known int inc,sf,coada[],i,elem; ^ componenteconexe5.cpp:12:5: error: 'viz' was not declared in this scope viz[nod]=nrc; ^ componenteconexe5.cpp:12:14: error: 'nrc' was not declared in this scope viz[nod]=nrc; ^ componenteconexe5.cpp:15:22: error: 'n' was not declared in this scope for (i=1; i<=n; i++) ^ componenteconexe5.cpp:16:12: error: 'a' was not declared in this scope if(a[elem][i]==1 && viz[i]==0){ ^ componenteconexe5.cpp:21:5: error: 'comp' was not declared in this scope comp[nrc]=sf; ^ componenteconexe5.cpp: In function 'int main()': componenteconexe5.cpp:28:8: error: 'm' was not declared in this scope in>>m>>n; ^ componenteconexe5.cpp:28:11: error: 'n' was not declared in this scope in>>m>>n; ^ componenteconexe5.cpp:29:9: error: 'i' was not declared in this scope for (i=1; i<=n; i++){ ^ componenteconexe5.cpp:30:9: error: 'x' was not declared in this scope in>>x>>y; ^ componenteconexe5.cpp:30:12: error: 'y' was not declared in this scope in>>x>>y; ^ componenteconexe5.cpp:31:5: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ componenteconexe5.cpp:33:9: error: 'i' was not declared in this scope for (i=1; i<=n; i++){ ^ componenteconexe5.cpp:34:8: error: 'viz' was not declared in this scope if(viz[i]==0){ ^ componenteconexe5.cpp:35:9: error: 'nrc' was not declared in this scope nrc++; ^ componenteconexe5.cpp:38:9: error: 'q' was not declared in this scope in>>q; ^ componenteconexe5.cpp:40:13: error: 'x' was not declared in this scope in>>x; ^ componenteconexe5.cpp:41:14: error: 'comp' was not declared in this scope out<<comp[viz[x]]<<endl; ^ componenteconexe5.cpp:41:19: error: 'viz' was not declared in this scope out<<comp[viz[x]]<<endl; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe5 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ă.