prog.cpp:16:1: error: ‘map’ does not name a type
map<pair<tn, pair<bool, bool>>, int> dp;
^~~
prog.cpp:12:12: error: ‘TreeNode’ has not been declared
#define tn TreeNode*
^~~~~~~~
prog.cpp:19:15: note: in expansion of macro ‘tn’
int solve(tn root, bool cam, bool parCam){
^~
prog.cpp:53:24: error: ‘TreeNode’ has not been declared
int minCameraCover(TreeNode* root) {
^~~~~~~~
prog.cpp: In member function ‘int Solution::solve(int*, bool, bool)’:
prog.cpp:20:20: error: ‘NULL’ was not declared in this scope
if(root == NULL){
^~~~
prog.cpp:20:20: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
prog.cpp:1:1:
+#include <cstddef>
/**
prog.cpp:20:20:
if(root == NULL){
^~~~
prog.cpp:24:18: error: request for member ‘left’ in ‘* root’, which is of non-class type ‘int’
if(root->left == NULL && root->right == NULL){
^~~~
prog.cpp:24:26: error: ‘NULL’ was not declared in this scope
if(root->left == NULL && root->right == NULL){
^~~~
prog.cpp:24:26: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
prog.cpp:24:40: error: request for member ‘right’ in ‘* root’, which is of non-class type ‘int’
if(root->left == NULL && root->right == NULL){
^~~~~
prog.cpp:34:12: error: ‘dp’ was not declared in this scope
if(dp.find({root, {cam, parCam}}) != dp.end())
^~
prog.cpp:37:20: error: ‘dp’ was not declared in this scope
return dp[{root, {cam, parCam}}] = 1 + min(solve(root->left, 0, 1), solve(root->left, 1, 1)) +
^~
prog.cpp:37:68: error: request for member ‘left’ in ‘* root’, which is of non-class type ‘int’
return dp[{root, {cam, parCam}}] = 1 + min(solve(root->left, 0, 1), solve(root->left, 1, 1)) +
^~~~
prog.cpp:37:93: error: request for member ‘left’ in ‘* root’, which is of non-class type ‘int’
return dp[{root, {cam, parCam}}] = 1 + min(solve(root->left, 0, 1), solve(root->left, 1, 1)) +
^~~~
prog.cpp:37:52: error: ‘min’ was not declared in this scope
return dp[{root, {cam, parCam}}] = 1 + min(solve(root->left, 0, 1), solve(root->left, 1, 1)) +
^~~
prog.cpp:38:41: error: request for member ‘right’ in ‘* root’, which is of non-class type ‘int’
min(solve(root->right, 0, 1), solve(root->right, 1, 1));
^~~~~
prog.cpp:38:67: error: request for member ‘right’ in ‘* root’, which is of non-class type ‘int’
min(solve(root->right, 0, 1), solve(root->right, 1, 1));
^~~~~
prog.cpp:42:24: error: ‘dp’ was not declared in this scope
return dp[{root, {cam, parCam}}] = min(solve(root->left, 0, 0), solve(root->left, 1, 0)) +
^~
prog.cpp:42:68: error: request for member ‘left’ in ‘* root’, which is of non-class type ‘int’
return dp[{root, {cam, parCam}}] = min(solve(root->left, 0, 0), solve(root->left, 1, 0)) +
^~~~
prog.cpp:42:93: error: request for member ‘left’ in ‘* root’, which is of non-class type ‘int’
return dp[{root, {cam, parCam}}] = min(solve(root->left, 0, 0), solve(root->left, 1, 0)) +
^~~~
prog.cpp:42:52: error: ‘min’ was not declared in this scope
return dp[{root, {cam, parCam}}] = min(solve(root->left, 0, 0), solve(root->left, 1, 0)) +
^~~
prog.cpp:43:41: error: request for member ‘right’ in ‘* root’, which is of non-class type ‘int’
min(solve(root->right, 0, 0), solve(root->right, 1, 0));
^~~~~
prog.cpp:43:67: error: request for member ‘right’ in ‘* root’, which is of non-class type ‘int’
min(solve(root->right, 0, 0), solve(root->right, 1, 0));
^~~~~
prog.cpp:46:39: error: request for member ‘left’ in ‘* root’, which is of non-class type ‘int’
int op1 = solve(root->left, 1, 0) + min(solve(root->right, 0, 0), solve(root->right, 1, 0));
^~~~
prog.cpp:46:69: error: request for member ‘right’ in ‘* root’, which is of non-class type ‘int’
int op1 = solve(root->left, 1, 0) + min(solve(root->right, 0, 0), solve(root->right, 1, 0));
^~~~~
prog.cpp:46:95: error: request for member ‘right’ in ‘* root’, which is of non-class type ‘int’
int op1 = solve(root->left, 1, 0) + min(solve(root->right, 0, 0), solve(root->right, 1, 0));
^~~~~
prog.cpp:46:53: error: ‘min’ was not declared in this scope
int op1 = solve(root->left, 1, 0) + min(solve(root->right, 0, 0), solve(root->right, 1, 0));
^~~
prog.cpp:47:39: error: request for member ‘right’ in ‘* root’, which is of non-class type ‘int’
int op2 = solve(root->right, 1, 0) + min(solve(root->left, 0, 0), solve(root->left, 1, 0));
^~~~~
prog.cpp:47:70: error: request for member ‘left’ in ‘* root’, which is of non-class type ‘int’
int op2 = solve(root->right, 1, 0) + min(solve(root->left, 0, 0), solve(root->left, 1, 0));
^~~~
prog.cpp:47:95: error: request for member ‘left’ in ‘* root’, which is of non-class type ‘int’
int op2 = solve(root->right, 1, 0) + min(solve(root->left, 0, 0), solve(root->left, 1, 0));
^~~~
prog.cpp:48:24: error: ‘dp’ was not declared in this scope
return dp[{root, {cam, parCam}}] = min(op1, op2);
^~
prog.cpp: In member function ‘int Solution::minCameraCover(int*)’:
prog.cpp:54:9: error: ‘dp’ was not declared in this scope
dp.clear();
^~
prog.cpp:55:16: error: ‘min’ was not declared in this scope
return min(solve(root, 0, 0), solve(root, 1, 0));
^~~