Index: lib/dataStructure/segmentTree.cpp ================================================================== --- lib/dataStructure/segmentTree.cpp +++ lib/dataStructure/segmentTree.cpp @@ -1,10 +1,11 @@ //------------------------------------------------------------- // Segment tree // in some general form // // Verified by +// - Codeforces 698 B (bug fixed) // - Codeforces 200 D // - Codeforces 107 C (old version) // - Codeforces 104 E (old version) //------------------------------------------------------------- @@ -103,10 +104,12 @@ } } void CalcMidNode(int lv, int idx) { + ResolveLazy(lv-1, idx*2); + ResolveLazy(lv-1, idx*2+1); tree[lv][idx] = Node::Concat(tree[lv-1][idx*2], tree[lv-1][idx*2+1]); } void ResolveLazy(int lv, int idx) {