Main.cpp:3:18: error: 'NULL' was not declared in this scope
3 | node *left = NULL, *right = NULL;
| ^~~~
Main.cpp:1:1: note: 'NULL' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
+++ |+#include <cstddef>
1 | struct node{
Main.cpp:3:33: error: 'NULL' was not declared in this scope
3 | node *left = NULL, *right = NULL;
| ^~~~
Main.cpp:3:33: note: 'NULL' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
Main.cpp: In function 'void check(node*)':
Main.cpp:9:19: error: 'NULL' was not declared in this scope
9 | if(x->left == NULL) {
| ^~~~
Main.cpp:9:19: note: 'NULL' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
Main.cpp:12:20: error: 'NULL' was not declared in this scope
12 | if(x->right == NULL) {
| ^~~~
Main.cpp:12:20: note: 'NULL' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
Main.cpp: In function 'void update(int, node*)':
Main.cpp:19:17: error: 'mp' was not declared in this scope
19 | x->mx = mp[x->l].get_max();
| ^~
Main.cpp:27:13: error: 'max' was not declared in this scope
27 | x->mx = max(x->left->mx, x->right->mx);
| ^~~
Main.cpp: In function 'int get(int, node*)':
Main.cpp:37:15: error: 'max' was not declared in this scope
37 | res = max(res, get(r, x->right));
| ^~~
Main.cpp: At global scope:
Main.cpp:42:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
42 | main() {
| ^~~~
Main.cpp: In function 'int main()':
Main.cpp:47:5: error: 'ios_base' has not been declared
47 | ios_base::sync_with_stdio(0);
| ^~~~~~~~
Main.cpp:48:5: error: 'cin' was not declared in this scope
48 | cin.tie(0);
| ^~~
Main.cpp:63:22: error: 'lg2' was not declared in this scope
63 | cr = lg2(-tmp&tmp);
| ^~~
Main.cpp:75:23: error: 'max' was not declared in this scope; did you mean 'mx'?
75 | ans = max(ans, k);
| ^~~
| mx
Main.cpp:78:9: error: 'cout' was not declared in this scope
78 | cout << ans;
| ^~~~
Main.cpp:81:5: error: 'stack' was not declared in this scope
81 | stack < int > st;
| ^~~~~
Main.cpp:81:13: error: expected primary-expression before 'int'
81 | stack < int > st;
| ^~~
Main.cpp:84:16: error: 'arr' was not declared in this scope
84 | cin >> arr[i];
| ^~~
Main.cpp:85:9: error: 'L' was not declared in this scope
85 | L[i] = arr[L[i - 1]] < arr[i] ? i : L[i - 1];
| ^
Main.cpp:87:13: error: 'mp' was not declared in this scope; did you mean 'm'?
87 | mp[arr[i - d - 1]].del();
| ^~
| m
Main.cpp:90:9: error: 'dp' was not declared in this scope; did you mean 'd'?
90 | dp[i] = get(arr[i], root) + 1;
| ^~
| d
Main.cpp:91:16: error: 'st' was not declared in this scope; did you mean 'std'?
91 | for(; !st.empty() && arr[st.top()] <= arr[i]; st.pop()) {
| ^~
| std
Main.cpp:92:21: error: 'max' was not declared in this scope
92 | dp[i] = max(dp[i], dp[st.top()] + (arr[st.top()] < arr[i]));
| ^~~
Main.cpp:96:25: error: 'max' was not declared in this scope
96 | dp[i] = max(dp[i], dp[cr] + (arr[cr] < arr[i]));
| ^~~
Main.cpp:99:9: error: 'st' was not declared in this scope; did you mean 'std'?
99 | st.push(i);
| ^~
| std
Main.cpp:100:9: error: 'mp' was not declared in this scope; did you mean 'm'?
100 | mp[arr[i]].add(dp[i]);
| ^~
| m
Main.cpp:105:12: error: 'st' was not declared in this scope; did you mean 'std'?
105 | for(; !st.empty(); st.pop()) {
| ^~
| std
Main.cpp:106:22: error: 'dp' was not declared in this scope; did you mean 'd'?
106 | mx = max(mx, dp[st.top()]);
| ^~
| d
Main.cpp:106:14: error: 'max' was not declared in this scope; did you mean 'mx'?
106 | mx = max(mx, dp[st.top()]);
| ^~~
| mx
Main.cpp:108:5: error: 'cout' was not declared in this scope
108 | cout << dp[13] << ' ';
| ^~~~
Main.cpp:108:13: error: 'dp' was not declared in this scope; did you mean 'd'?
108 | cout << dp[13] << ' ';
| ^~
| d
Main.cpp:50:12: warning: unused variable 'm' [-Wunused-variable]
50 | int n, m, d;
| ^