#4154
Se dă un graf orientat cu n noduri. Să se determine câte componente tare conexe ale grafului sunt formate dintr-un singur nod.
| Problema | ComponenteTC | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64311550 | Utilizator | |
| Fișier | componentetc.cpp | Dimensiune | 1.16 KB |
| Data încărcării | 29 Aprilie 2026, 09:31 | Scor/rezultat | Eroare de compilare |
componentetc.cpp: In function ‘void dfs(int, int)’: componentetc.cpp:9:9: error: ‘dfs1’ was not declared in this scope; did you mean ‘dfs’? 9 | dfs1(i, nr); | ^~~~ | dfs componentetc.cpp: In function ‘int poz()’: componentetc.cpp:26:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 26 | for(int i=1; i<=n; i++) | ^~~ componentetc.cpp:28:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 28 | return 0; | ^~~~~~ componentetc.cpp: In function ‘int main()’: componentetc.cpp:39:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 39 | while(k=0) | ~^~ componentetc.cpp:42:9: error: ‘dfs1’ was not declared in this scope; did you mean ‘dfs2’? 42 | dfs1(k,nr); | ^~~~ | dfs2 componentetc.cpp:48:16: error: expected ‘;’ before ‘i’ 48 | for(int i=1 i<=n; i++) | ^~ | ; componentetc.cpp:51:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 51 | for(int j=1; j<=n; j++) | ^~~ componentetc.cpp:53:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 53 | if(nrm==1) comp++; | ^~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteTC 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ă.