prog.cpp:3:5: error: ‘vector’ does not name a type
vector<vector<int>> adj;
^~~~~~
prog.cpp:4:5: error: ‘vector’ does not name a type
vector<int> g;
^~~~~~
prog.cpp:29:39: error: ‘vector’ has not been declared
long long interactionCosts(int n, vector<vector<int>>& edges, vector<int>& group) {
^~~~~~
prog.cpp:29:45: error: expected ‘,’ or ‘...’ before ‘<’ token
long long interactionCosts(int n, vector<vector<int>>& edges, vector<int>& group) {
^
prog.cpp: In member function ‘int Solution::dfs(int, int, int, long long int)’:
prog.cpp:10:20: error: ‘g’ was not declared in this scope
int cnt = (g[u] == tar) ? 1 : 0;
^
prog.cpp:13:22: error: ‘adj’ was not declared in this scope
for (int v : adj[u]) {
^~~
prog.cpp: In member function ‘long long int Solution::interactionCosts(int, int)’:
prog.cpp:30:9: error: ‘adj’ was not declared in this scope
adj.resize(n);
^~~
prog.cpp:31:9: error: ‘g’ was not declared in this scope
g = group;
^
prog.cpp:31:13: error: ‘group’ was not declared in this scope
g = group;
^~~~~
prog.cpp:35:24: error: ‘edges’ was not declared in this scope
for (auto &e : edges) {
^~~~~
prog.cpp:41:9: error: ‘vector’ was not declared in this scope
vector<int> sz(21, 0);
^~~~~~
prog.cpp:41:16: error: expected primary-expression before ‘int’
vector<int> sz(21, 0);
^~~
prog.cpp:42:22: error: unable to deduce ‘auto&&’ from ‘group’
for (int x : group) {
^~~~~
prog.cpp:43:13: error: ‘sz’ was not declared in this scope
sz[x]++;
^~
prog.cpp:48:17: error: ‘sz’ was not declared in this scope
if (sz[i] >= 2) {
^~