Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *** main.cpp.old Sun May 3 16:37:45 2020
- --- main.cpp Sun May 3 16:34:23 2020
- ***************
- *** 181,182 ****
- --- 181,184 ----
- + vector<int> pos(n);
- +
- for (int cx = 1; cx < BUBEN; ++cx) {
- ***************
- *** 185,186 ****
- --- 187,189 ----
- for (int i = 0; i < n; ++i) {
- + pos[i] = byDepth[depth[i] % cx].size();
- byDepth[depth[i] % cx].push_back(i);
- ***************
- *** 210,212 ****
- int y = depth[a] % x;
- ! int from = lower_bound(all(byDepth[y]), a) - byDepth[y].begin();
- results[mi] += fget(byDepthFenwick[y], from);
- --- 213,215 ----
- int y = depth[a] % x;
- ! int from = pos[a];
- results[mi] += fget(byDepthFenwick[y], from);
- ***************
Advertisement
Add Comment
Please, Sign In to add comment