prize.cpp:57:54: error: 'n' was not declared in this scope
void add(int qs,int qe,double what,int l=0,int r=n-1,int i=1)
^
prize.cpp:73:38: error: 'n' was not declared in this scope
int get_random_pos(int l=0,int r=n-1,int i=1)
^
prize.cpp: In function 'int find_best(int)':
prize.cpp:109:37: error: call to 'int segTree::get_random_pos(int, int, int)' uses the default argument for parameter 2, which is not yet defined
int pos=tree.get_random_pos();
^
prize.cpp:115:27: error: call to 'void segTree::add(int, int, double, int, int, int)' uses the default argument for parameter 5, which is not yet defined
tree.add(pos,pos,0);
^
prize.cpp:116:41: error: call to 'void segTree::add(int, int, double, int, int, int)' uses the default argument for parameter 5, which is not yet defined
tree.add(0,pos-1,(double)tr[0]/t);
^
prize.cpp:117:43: error: call to 'void segTree::add(int, int, double, int, int, int)' uses the default argument for parameter 5, which is not yet defined
tree.add(pos+1,n-1,(double)tr[1]/t);
^