#include using namespace std; #define ALL(a) (a).begin(),(a).end() #define ALLR(a) (a).rbegin(),(a).rend() #define spa << " " << #define lfs <= (ll)(m); i--) typedef long long ll; typedef long double ld; const ll MOD = 1e9+7; //const ll MOD = 998244353; const ll INF = 1e18; using P = pair; template void chmin(T &a,T b){if(a>b)a=b;} template void chmax(T &a,T b){if(a void ans(bool x,T1 y,T2 z){if(x)cout< void debug(vector>v,ll h,ll w){for(ll i=0;iv,ll h,ll w){for(ll i=0;i void debug(vectorv,ll n){cout< vector>vec(ll x, ll y, T w){ vector>v(x,vector(y,w));return v;} ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;} template void emp(map&m, T x){m.emplace(x,0).first->second++;} template struct SegmentTree{ using F = function; vector data; ll n,lastlen = 1; F func = [](T a, T b){return a < b ? a : b;}; T iden = MP(INT_MAX,INT_MAX); //identity element SegmentTree(vector v){ n = (ll)v.size(); while(lastlen < n)lastlen *= 2; data.assign(lastlen*2-1,iden); for(ll i=0;i=0;i--){ data[i] = func(data[2*i+1], data[2*i+2]); } } void update(ll point, T x){ point+=lastlen-1; data[point] = x; while(point!=0){ point=(point-1)/2; data[point]=func(data[2*point+1],data[2*point+2]); } } T query(ll a,ll b,ll point=0,ll left=0,ll right=-1){ if(right<0)right=lastlen; T ret = iden; if(b <= left || right <= a); else if(a <= left && right <= b ){ ret = func(ret, data[point]); } else{ T p,q; p = query(a,b,point*2+1,left, (left+right)/2); q = query(a,b,point*2+2,(left+right)/2, right); ret = func(ret,p); ret = func(ret,q); } return ret; } }; int main(){ cin.tie(NULL); ios_base::sync_with_stdio(false); ll res=0,res1=INF,res2=-INF,buf=0; bool judge = true; ll n,q;cin>>n>>q; vectorp(q),l(q),r(q); vector

a(n); rep(i,0,n)cin>>a[i].fi; rep(i,0,n)a[i].se=i+1; rep(i,0,q)cin>>p[i]>>l[i]>>r[i]; SegmentTree

segtree(a); rep(i,0,q){ if(p[i]==2){ cout<