Skip to content

Commit a8b9b5a

Browse files
committed
golf
1 parent 7f6ed44 commit a8b9b5a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

library/data_structures_[l,r)/uncommon/priority_queue_of_updates.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ template<class F, class G> struct pq_updates {
2020
F upd;
2121
G undo;
2222
multimap<int, int> mp;
23-
vector<pair<multimap<int, int>::iterator, H>> st;
23+
vector<pair<decltype(end(mp)), H>> st;
2424
pq_updates(F upd, G undo): upd(upd), undo(undo) {}
2525
void push(int pri, H upd_params) {
2626
upd(upd_params);
@@ -31,8 +31,8 @@ template<class F, class G> struct pq_updates {
3131
for (auto& [_, i] : mp) {
3232
l = min(l, i);
3333
if (--r != i) {
34-
swap(st[r], st[i]);
35-
swap(i, st[i].first->second);
34+
swap(st[i], st[r]);
35+
swap(st[i].first->second, i);
3636
}
3737
if (r - l <= sz(st) - r) break;
3838
}

0 commit comments

Comments
 (0)