prog.cpp:3:23: error: ‘NULL’ was not declared in this scope
wavelet_tree *lft=NULL,*rgt=NULL;
^~~~
prog.cpp:3:23: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
prog.cpp:1:1:
+#include <cstddef>
struct wavelet_tree{///1 indexed
prog.cpp:3:23:
wavelet_tree *lft=NULL,*rgt=NULL;
^~~~
prog.cpp:3:33: error: ‘NULL’ was not declared in this scope
wavelet_tree *lft=NULL,*rgt=NULL;
^~~~
prog.cpp:3:33: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
prog.cpp:4:15: error: ‘NULL’ was not declared in this scope
int *pref=NULL;
^~~~
prog.cpp:4:15: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
prog.cpp:5:17: error: ‘NULL’ was not declared in this scope
long long *sum=NULL;
^~~~
prog.cpp:5:17: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
prog.cpp: In constructor ‘wavelet_tree::wavelet_tree(int*, int*, int, int)’:
prog.cpp:18:22: error: ‘stable_partition’ was not declared in this scope
int *pivot = stable_partition(l,r,[&](int x){return x<=mid;});
^~~~~~~~~~~~~~~~
prog.cpp: In destructor ‘wavelet_tree::~wavelet_tree()’:
prog.cpp:31:18: error: ‘NULL’ was not declared in this scope
if(pref!=NULL)delete []pref;
^~~~
prog.cpp:31:18: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
prog.cpp:32:11: error: ‘NULL’ was not declared in this scope
if(sum!=NULL)delete []sum;
^~~~
prog.cpp:32:11: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
prog.cpp:33:17: error: ‘NULL’ was not declared in this scope
if(lft!=NULL)delete lft;
^~~~
prog.cpp:33:17: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
prog.cpp:34:17: error: ‘NULL’ was not declared in this scope
if(rgt!=NULL)delete rgt;
^~~~
prog.cpp:34:17: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?