0_0_24547188_3475.cpp:14:38: error: expected ';' at end of member declaration
TreeNode(int _l = -1, int _r = -1) l(_l), r(_r) {}
^
0_0_24547188_3475.cpp:14:42: error: '_l' has not been declared
TreeNode(int _l = -1, int _r = -1) l(_l), r(_r) {}
^
0_0_24547188_3475.cpp:14:45: error: 'int TreeNode::l(int)' conflicts with a previous declaration
TreeNode(int _l = -1, int _r = -1) l(_l), r(_r) {}
^
0_0_24547188_3475.cpp:13:9: note: previous declaration 'int TreeNode::l'
int l, r, val;
^
0_0_24547188_3475.cpp:14:49: error: '_r' has not been declared
TreeNode(int _l = -1, int _r = -1) l(_l), r(_r) {}
^
0_0_24547188_3475.cpp:14:54: error: 'int TreeNode::r(int)' conflicts with a previous declaration
TreeNode(int _l = -1, int _r = -1) l(_l), r(_r) {}
^
0_0_24547188_3475.cpp:13:12: note: previous declaration 'int TreeNode::r'
int l, r, val;
^
0_0_24547188_3475.cpp: In function 'void buildTree(int)':
0_0_24547188_3475.cpp:24:46: error: invalid use of member (did you forget the '&' ?)
if (pla[root] == 0) tree[root].l = node[root].child[i];
^
0_0_24547188_3475.cpp:25:36: error: invalid use of member (did you forget the '&' ?)
else tree[pla[root]].r = node[root].child[i];
^
0_0_24547188_3475.cpp: In function 'int dp(int, int)':
0_0_24547188_3475.cpp:35:31: error: cannot convert 'TreeNode::r' from type 'int (TreeNode::)(int)' to type 'int'
int tmp = dp (tree[i].r, q);
^
0_0_24547188_3475.cpp:37:41: error: cannot convert 'TreeNode::l' from type 'int (TreeNode::)(int)' to type 'int'
tmp = max (tmp, dp (tree[i].l, k) + dp (tree[i].r, q - k - 1) + val[i]);
^
0_0_24547188_3475.cpp:37:69: error: cannot convert 'TreeNode::r' from type 'int (TreeNode::)(int)' to type 'int'
tmp = max (tmp, dp (tree[i].l, k) + dp (tree[i].r, q - k - 1) + val[i]);
^
0_0_24547188_3475.cpp: In function 'int main()':
0_0_24547188_3475.cpp:44:32: error: expected ';' before ':' token
memset(pla, 0, sizeof(pla)):
^
|