| 110 | } |
| 111 | |
| 112 | void query(int k, int l, int r, int x, ThinHashSet<int>& cover_seg) { |
| 113 | if (m_seg_info.find(k) != m_seg_info.end()) { |
| 114 | for (auto x : m_seg_info[k]) { |
| 115 | cover_seg.insert(x); |
| 116 | } |
| 117 | } |
| 118 | if (l == r) { |
| 119 | mgb_assert( |
| 120 | x == l, |
| 121 | "bug occurs in memory_swap's Segment Tree in line %s:%d " |
| 122 | "%s\n", |
| 123 | __FILE__, __LINE__, __FUNCTION__); |
| 124 | return; |
| 125 | } |
| 126 | int mid = (l + r) >> 1; |
| 127 | if (x <= mid) |
| 128 | query(k << 1, l, mid, x, cover_seg); |
| 129 | else |
| 130 | query(k << 1 | 1, mid + 1, r, x, cover_seg); |
| 131 | } |
| 132 | }; |
| 133 | |
| 134 | /* ================ MemorySwap ================ */ |
no test coverage detected