//yuki875.cpp //Sun Jan 5 17:24:15 2020 #include #include #include #include #include #include #include #include #include #define INTINF 2147483647 #define LLINF 9223372036854775807 using namespace std; using ll=long long; typedef pair P; int seg[4*100000]; int nodenum; void init(int n){ nodenum = 1; while (nodenum0){ index = (index-1)/2; seg[index] = min(seg[index*2+1],seg[index*2+2]); } } //Note that query is [a,b). int query(int a, int b, int k, int l, int r){ if (r<=a || b<=l){ return INTINF; } if (a<=l && r<=b){ return seg[k]; }else { int vl = query(a,b,k*2+1,l,(l+r)/2); int vr = query(a,b,k*2+2,(l+r)/2,r); return min(vl,vr); } } int main(){ int n,q; cin >> n >> q; init(n); for (int i=0;i> seg[nodenum-1+i]; } for (int i=nodenum-2;i>=0;i--){ seg[i] = min(seg[i*2+1],seg[i*2+2]); } for (int i=0;i> num >> l >> r; l--;r--; if (num==2){ int ans = query(l,r+1,0,0,nodenum); for (int i=0;i