0_0_36514076_11647.cpp: In function 'void solve()':
0_0_36514076_11647.cpp:20:58: error: expected ',' or ';' before '}' token
parent[p.first]=node;pw[p.first]=p.second;dfs(p.first);}}};dfs(0, -1);
^
0_0_36514076_11647.cpp: At global scope:
0_0_36514076_11647.cpp:20:63: error: expected constructor, destructor, or type conversion before '(' token
parent[p.first]=node;pw[p.first]=p.second;dfs(p.first);}}};dfs(0, -1);
^
0_0_36514076_11647.cpp: In lambda function:
0_0_36514076_11647.cpp:21:51: error: 'dp1' was not declared in this scope
function <ll(int)> getdp1 = [&](int node) {ll&res=dp1[node];if(res)return res;
^
0_0_36514076_11647.cpp:22:7: error: 'vals' was not declared in this scope
res = vals[node];
^
0_0_36514076_11647.cpp:23:11: error: 'adj' was not declared in this scope
for(pii&p:adj[node]){
^
0_0_36514076_11647.cpp:24:13: error: 'parent' was not declared in this scope
if(p.first==parent[node])continue;ans=max(ans,ans+getdp1(p.first)-2*p.second);}return res;};
^
0_0_36514076_11647.cpp:24:35: error: 'ans' was not declared in this scope
if(p.first==parent[node])continue;ans=max(ans,ans+getdp1(p.first)-2*p.second);}return res;};
^
0_0_36514076_11647.cpp: In lambda function:
0_0_36514076_11647.cpp:25:50: error: 'dp2' was not declared in this scope
function<ll(int)> getdp2 = [&](int node) {ll&res=dp2[node];if(res)return res;
^
0_0_36514076_11647.cpp:26:37: error: 'adj' was not declared in this scope
res=getdp1(node);ll add=0;for(pii&p:adj[node]{
^
0_0_36514076_11647.cpp:26:46: error: expected ')' before '{' token
res=getdp1(node);ll add=0;for(pii&p:adj[node]{
^
0_0_36514076_11647.cpp:27:13: error: 'parent' was not declared in this scope
if(p.first==parent[node])continue;add=max(add,getdp2(p.first)-p.second-max(getdp1(p.first)-2*p.second,0));
^
0_0_36514076_11647.cpp:27:104: error: no matching function for call to 'max(long long int, int)'
if(p.first==parent[node])continue;add=max(add,getdp2(p.first)-p.second-max(getdp1(p.first)-2*p.second,0));
^
0_0_36514076_11647.cpp:27:104: note: candidates are:
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/char_traits.h:39:0,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/ios:40,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/istream:38,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/sstream:38,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/complex:45,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/ccomplex:38,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/bits/stdc++.h:52,
from 0_0_36514076_11647.cpp:1:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_algobase.h:217:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
max(const _Tp& __a, const _Tp& __b)
^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_algobase.h:217:5: note: template argument deduction/substitution failed:
0_0_36514076_11647.cpp:27:104: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
if(p.first==parent[node])continue;add=max(add,getdp2(p.first)-p.second-max(getdp1(p.first)-2*p.second,0));
^
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/char_traits.h:39:0,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/ios:40,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/istream:38,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/sstream:38,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/complex:45,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/ccomplex:38,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/bits/stdc++.h:52,
from 0_0_36514076_11647.cpp:1:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_algobase.h:261:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_algobase.h:261:5: note: template argument deduction/substitution failed:
0_0_36514076_11647.cpp:27:104: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
if(p.first==parent[node])continue;add=max(add,getdp2(p.first)-p.second-max(getdp1(p.first)-2*p.second,0));
^
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/algorithm:62:0,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/bits/stdc++.h:64,
from 0_0_36514076_11647.cpp:1:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_algo.h:3449:5: note: template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)
max(initializer_list<_Tp> __l)
^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_algo.h:3449:5: note: template argument deduction/substitution failed:
0_0_36514076_11647.cpp:27:104: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
if(p.first==parent[node])continue;add=max(add,getdp2(p.first)-p.second-max(getdp1(p.first)-2*p.second,0));
^
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/algorithm:62:0,
from GCC4.9.2/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/bits/stdc++.h:64,
from 0_0_36514076_11647.cpp:1:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_algo.h:3454:5: note: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)
max(initializer_list<_Tp> __l, _Compare __comp)
^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_algo.h:3454:5: note: template argument deduction/substitution failed:
0_0_36514076_11647.cpp:27:104: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
if(p.first==parent[node])continue;add=max(add,getdp2(p.first)-p.second-max(getdp1(p.first)-2*p.second,0));
^
0_0_36514076_11647.cpp: In lambda function:
0_0_36514076_11647.cpp:29:79: error: 'dp3' was not declared in this scope
function<ll(int)>getdp3=[&](int node){if(node==0){return getdp1(node);}ll&ans=dp3[node];
^
0_0_36514076_11647.cpp:30:30: error: 'parent' was not declared in this scope
if(ans)return ans;ans=getdp3(parent[node])+getdp1(parent[node])-max(getdp1(node)-2*pw[node],0);return ans;};
^
0_0_36514076_11647.cpp:30:84: error: 'pw' was not declared in this scope
if(ans)return ans;ans=getdp3(parent[node])+getdp1(parent[node])-max(getdp1(node)-2*pw[node],0);return ans;};
^
0_0_36514076_11647.cpp: In lambda function:
0_0_36514076_11647.cpp:31:77: error: 'dp4' was not declared in this scope
function<ll(int)>getdp4=[&](int node){if(node==0)return getdp2(node);ll&ans=dp4[node];
^
0_0_36514076_11647.cpp:32:34: error: 'parent' was not declared in this scope
if(ans)return ans;ans=max(getdp1(parent[node]-max(getdp1(node)-2*pw[node],0),getdp3(parent[node])+getdp2(parent[node]));return ans;};
^
0_0_36514076_11647.cpp:32:66: error: 'pw' was not declared in this scope
if(ans)return ans;ans=max(getdp1(parent[node]-max(getdp1(node)-2*pw[node],0),getdp3(parent[node])+getdp2(parent[node]));return ans;};
^
0_0_36514076_11647.cpp: At global scope:
0_0_36514076_11647.cpp:33:1: error: expected unqualified-id before 'for'
for(int i=0;i<n;i++){cout<<getdp4(i)<<" ";}cout<<endl;
^
0_0_36514076_11647.cpp:33:13: error: 'i' does not name a type
for(int i=0;i<n;i++){cout<<getdp4(i)<<" ";}cout<<endl;
^
0_0_36514076_11647.cpp:33:17: error: 'i' does not name a type
for(int i=0;i<n;i++){cout<<getdp4(i)<<" ";}cout<<endl;
^
0_0_36514076_11647.cpp:33:44: error: 'cout' does not name a type
for(int i=0;i<n;i++){cout<<getdp4(i)<<" ";}cout<<endl;
^
0_0_36514076_11647.cpp:34:1: error: expected declaration before '}' token
}
^
|