friend.cpp:3:1: error: 'vector' does not name a type
3 | vector<int> adj[MAXN];
| ^~~~~~
friend.cpp: In function 'int dfs(int, bool)':
friend.cpp:10:18: error: 'adj' was not declared in this scope
10 | for (int nxt : adj[x]) ans += dfs(nxt, 0);
| ^~~
friend.cpp:13:18: error: 'adj' was not declared in this scope
13 | for (int nxt : adj[x]) ans += max(dfs(nxt, 1), dfs(nxt, 0));
| ^~~
friend.cpp:13:33: error: 'max' was not declared in this scope
13 | for (int nxt : adj[x]) ans += max(dfs(nxt, 1), dfs(nxt, 0));
| ^~~
friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:20:18: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
20 | if (protocol[1] = 0){
| ~~~~~~~~~~~~^~~
friend.cpp:21:31: error: 'adj' was not declared in this scope
21 | for (int i = 1; i < n; i++) adj[host[i]].push_back(i);
| ^~~
friend.cpp:22:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
22 | for (int i = 0; i < n; i++) conf[i] = confidence[i];x
| ^~~
friend.cpp:22:55: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
22 | for (int i = 0; i < n; i++) conf[i] = confidence[i];x
| ^
friend.cpp:22:55: error: 'x' was not declared in this scope
friend.cpp:25:23: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
25 | else if (protocol[1] = 1){
| ~~~~~~~~~~~~^~~
friend.cpp:32:37: error: 'max' was not declared in this scope
32 | for (int i = 0; i < n; i++) ans = max(ans, confidence[i]);
| ^~~
friend.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type]
35 | }
| ^