#583
Se dă un graf orientat cu n noduri. Să se determine câte componente tare conexe are graful dat.
| Problema | Tare conexitate | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64520925 | Utilizator | |
| Fișier | tare_conexitate.cpp | Dimensiune | 713 B |
| Data încărcării | 12 Mai 2026, 11:55 | Scor/rezultat | Eroare de compilare |
tare_conexitate.cpp: In function ‘void df1(int, int*)’: tare_conexitate.cpp:8:16: error: too few arguments to function ‘void df1(int, int*)’ 8 | df1(i); | ~~~^~~ tare_conexitate.cpp:3:6: note: declared here 3 | void df1(int x, int s[101]) | ^~~ tare_conexitate.cpp: In function ‘void df2(int)’: tare_conexitate.cpp:13:5: error: ‘p’ was not declared in this scope 13 | p[x] = 1; | ^ tare_conexitate.cpp: In function ‘int main()’: tare_conexitate.cpp:21:5: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’? 21 | cin>>n; | ^~~ | std::cin In file included from tare_conexitate.cpp:1: /usr/include/c++/13/iostream:62:18: note: ‘std::cin’ declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ tare_conexitate.cpp:23:12: error: ‘ctc’ was not declared in this scope 23 | if(ctc[i] == 0) | ^~~ tare_conexitate.cpp:26:17: error: ‘s’ was not declared in this scope 26 | s[j] = p[j] = 0; | ^ tare_conexitate.cpp:26:24: error: ‘p’ was not declared in this scope 26 | s[j] = p[j] = 0; | ^ tare_conexitate.cpp:27:13: error: ‘nrc’ was not declared in this scope 27 | nrc ++; | ^~~ tare_conexitate.cpp:28:16: error: too few arguments to function ‘void df1(int, int*)’ 28 | df1(i); df2(i); | ~~~^~~ tare_conexitate.cpp:3:6: note: declared here 3 | void df1(int x, int s[101]) | ^~~ tare_conexitate.cpp:30:20: error: ‘s’ was not declared in this scope 30 | if(s[j] == 1 && p[j] == 1) | ^ tare_conexitate.cpp:30:33: error: ‘p’ was not declared in this scope 30 | if(s[j] == 1 && p[j] == 1) | ^ tare_conexitate.cpp: At global scope: tare_conexitate.cpp:34:1: error: ‘cout’ does not name a type 34 | cout<<nrc; | ^~~~ tare_conexitate.cpp:36:5: error: expected unqualified-id before ‘return’ 36 | return 0; | ^~~~~~ tare_conexitate.cpp:37:1: error: expected declaration before ‘}’ token 37 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Tare conexitate 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ă.