Borderou de evaluare (job #3376814)

Utilizator biancagravaGRAVA Bianca biancagrava Data 19 noiembrie 2026 21:42:09
Problema Parcurgere DFS - componente conexe Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp:12:22: error: 'vector' does not name a type 12 | void dfs(int i,const vector<int> adj[],vector<int> &comp,int nr) { | ^~~~~~ main.cpp:12:28: error: expected ',' or '...' before '<' token 12 | void dfs(int i,const vector<int> adj[],vector<int> &comp,int nr) { | ^ main.cpp: In function 'void dfs(int, int)': main.cpp:18:14: error: 'comp' was not declared in this scope 18 | if ( comp[t] == 0){ | ^~~~ main.cpp:19:27: error: 'adj' was not declared in this scope 19 | for (int elem:adj[t]) | ^~~ main.cpp:21:21: error: 'nr' was not declared in this scope 21 | comp[t]=nr; | ^~ main.cpp: In function 'int main()': main.cpp:29:5: error: 'vector' was not declared in this scope 29 | vector<int> adj[n+1],comp(n+1,0); | ^~~~~~ main.cpp:7:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'? 6 | #include<stack> +++ |+#include <vector> 7 | using namespace std; main.cpp:29:12: error: expected primary-expression before 'int' 29 | vector<int> adj[n+1],comp(n+1,0); | ^~~ main.cpp:33:9: error: 'adj' was not declared in this scope 33 | adj[u].push_back(v); | ^~~ main.cpp:38:13: error: 'comp' was not declared in this scope 38 | if (comp[i]==0) { | ^~~~ main.cpp:40:19: error: 'adj' was not declared in this scope 40 | dfs(i,adj,comp,nr); | ^~~ Non zero exit status: 1

Ceva nu functioneaza?