#include using namespace std; #define PRINT_VALUE(v){cout<<#v<<" :"<> st; vector log; int n; public: SparseTable(const vector &arr){ n=arr.size(); int K=log2(n)+1; st.assign(n,vector(K)); log.assign(n+1,0); log[1]=0; for(int i=2;i<=n;i++){ log[i]=log[i/2]+1; } for(int i=0;ilog[r-l+1]; return min(this->st[l][j],this->st[r-(1<=(1< v={1, 3, 5, 7, 9, 11}; SparseTable st_min(v); // PRINT_VALUE(st_min.query(1,2)); PRINT_VALUE(st_min.query(1, 4)); }