Diff
Not logged in

Differences From Artifact [fb4d697dde7b0758]:

To Artifact [7137a382264b4c89]:


1 1 //------------------------------------------------------------- 2 2 // Segment tree 3 3 // in some general form 4 4 // 5 5 // Verified by 6 +// - Codeforces 698 B (bug fixed) 6 7 // - Codeforces 200 D 7 8 // - Codeforces 107 C (old version) 8 9 // - Codeforces 104 E (old version) 9 10 //------------------------------------------------------------- 10 11 11 12 class SegmentTree 12 13 { ................................................................................ 101 102 SetRec(s,e,n,lv-1,idx*2+1,stride/2); 102 103 CalcMidNode(lv, idx); 103 104 } 104 105 } 105 106 106 107 void CalcMidNode(int lv, int idx) 107 108 { 109 + ResolveLazy(lv-1, idx*2); 110 + ResolveLazy(lv-1, idx*2+1); 108 111 tree[lv][idx] = Node::Concat(tree[lv-1][idx*2], tree[lv-1][idx*2+1]); 109 112 } 110 113 111 114 void ResolveLazy(int lv, int idx) 112 115 { 113 116 if(tree[lv][idx].lazy) { 114 117 if(lv > 0) {