摘要: 好题。 1 #include 2 #include 3 #include 4 using namespace std; 5 int CASE=1; 6 const int maxn=500000+5; 7 typedef long long LL; 8 typedef pair Interval; 9 int qL,qR; 10 LL s[maxn]; 11 Interval max_sub[maxnsum(b)?a:b; 26 } 27 void build(int l,int r,int rt) 28 { 29 if(l==r) 30 { 31 m... 阅读全文
posted @ 2013-08-24 23:59 sooflow 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 这道题很狗血啊 赋值的时候那个v是大于等于0来着,主要考察区间赋值和更新,pushdown同时要有两个操作。代码如下: 1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn=1000000+5; 6 const int INF=1000000009; 7 int sum[maxn=0) 23 { 24 add[rt>1; 52 build(l,m,rt>1; 68 if(Lm) update(L,R,inc,m+1,r,rt>1; 84 if(Lm... 阅读全文
posted @ 2013-08-24 23:56 sooflow 阅读(383) 评论(0) 推荐(0) 编辑