求中个奖——狗头:int main(){ // freopen(".in","r",stdin); // freopen(".out","w",stdout); n=read();m=read(); for(_R int i=2;i<=n+1;++i)a[i]=read(); maxx[0]=-INF;a[1]=a[n+2]=-INF; root=build(0,1,n+2); int op,l,r,x,val; while(m--){ op=read(); if(op==1)x=read()+1,printf("%d\n",query(x)); if(op==2)x=read()+1,val=read(),revise(x,val); if(op==3)l=read()+1,r=read()+1,printf("%d\n",query(l,r,0)); if(op==4)l=read()+1,r=read()+1,printf("%d\n",query(l,r,1)); if(op==5)l=read()+1,r=read()+1,reverse(l,r); } return 0; }
0 点赞 评论 收藏
分享
关注他的用户也关注了: