版本比较
【清华集训2015】V
正文
增加 7 行删除 7 行
21 行未改动2223242526262728293024 行未改动5556575859596061626352 行未改动1161171181191201201211221231241251251261271281291301301311321331341351351361371381391401411411421431441457 行未改动21 行未改动```cpp//12252024832524#include <cstdio>#include <algorithm>using namespace std; using namespace std;
typedef long long LL;const int MAXN = 500005;const LL INF = 0x3f3f3f3f3f3f3f3fll;24 行未改动
struct node{ int l,r; LL x,y,tx,ty;//当前的与历史的 LL x,y,tx,ty;//当前的与历史的 node(){} node(int l1,int r1,LL x1,LL y1,LL tx1,LL ty1){ l = l1; r = r1;52 行未改动 Build(1,1,n); for(; m ;-- m) { int opt = Read(); if(opt == 1)//区间加 if(opt == 1)//区间加 { int l = Read(),r = Read(),x = Read(); change(1,l,r,node(0,0,x,-INF,x,-INF)); } else if(opt == 2)//区间减 else if(opt == 2)//区间减 { int l = Read(),r = Read(),x = Read(); change(1,l,r,node(0,0,-x,0,-x,0)); } else if(opt == 3)//区间赋值 else if(opt == 3)//区间赋值 { int l = Read(),r = Read(),x = Read(); change(1,l,r,node(0,0,-INF,x,-INF,x)); } else if(opt == 4)//单点询问 else if(opt == 4)//单点询问 { int x = Read(); node ans = query(1,x); Put(Max(a[x]+ans.x,ans.y),'\n'); } else if(opt == 5)//历史最大值 else if(opt == 5)//历史最大值 { int x = Read(); node ans = query(1,x); Put(Max(a[x]+ans.tx,ans.ty),'\n');7 行未改动