friend.cpp:1:1: error: 'include' does not name a type; did you mean '__has_include'?
include <bits/stdc++.h>
^~~~~~~
__has_include
friend.cpp:6:1: error: 'vector' does not name a type
vector<int> g[NMAX];
^~~~~~
friend.cpp: In function 'void dfs(int, int)':
friend.cpp:12:9: error: 'max' was not declared in this scope
ans=max(ans,w[son]);
^~~
friend.cpp:13:15: error: 'g' was not declared in this scope
for(int i:g[son]) if(!vis[i]) dfs(i,son);
^
friend.cpp: In function 'void dfs1(int, int)':
friend.cpp:20:15: error: 'g' was not declared in this scope
for(int i:g[son])
^
friend.cpp:24:21: error: 'max' was not declared in this scope
dp[son][0]+=max(dp[i][0],dp[i][1]);
^~~
friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:41:13: error: 'g' was not declared in this scope
g[host[i]].push_back(i);
^
friend.cpp:47:23: error: 'g' was not declared in this scope
for(int j:g[host[i]])
^
friend.cpp:56:13: error: 'g' was not declared in this scope
g[host[i]].push_back(i);
^
friend.cpp:71:13: error: 'vector' was not declared in this scope
vector<int> tmp;
^~~~~~
friend.cpp:71:20: error: expected primary-expression before 'int'
vector<int> tmp;
^~~
friend.cpp:72:50: error: 'tmp' was not declared in this scope
for(int i=0;i<n;i++) if(mask&(1<<i)) tmp.push_back(i);
^~~
friend.cpp:75:23: error: 'tmp' was not declared in this scope
for(int i:tmp)
^~~
friend.cpp:77:27: error: unable to deduce 'auto&&' from 'tmp'
for(int j:tmp)
^~~
friend.cpp:80:31: error: 'g' was not declared in this scope
for(int t:g[i]) if(t==j) ok=0;
^
friend.cpp:85:30: error: 'tmp' was not declared in this scope
if(ok) for(int i:tmp) ans+=confidence[i];
^~~
friend.cpp:86:24: error: 'max' was not declared in this scope
if(ok) res=max(res,ans);
^~~
friend.cpp:86:24: note: suggested alternative: 'mask'
if(ok) res=max(res,ans);
^~~
mask
friend.cpp:106:58: error: 'max' was not declared in this scope
for(int i=0;i<n;i++) if(!vis[i]){dfs1(i,0); res+=max(dp[i][0],dp[i][1]);}
^~~
friend.cpp:109:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^