Skip to content

Commit 01d2403

Browse files
committed
update example init
1 parent 2e00c53 commit 01d2403

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
#pragma once
22
//! https://codeforces.com/blog/entry/111117
33
//! @code
4+
//! RollbackUF uf(n);
5+
//! vector<int> hist;
46
//! vector<pair<int, int>> updates;
5-
//! pq_updates pq([&](int update_id) {},
6-
//! [&]() {});
7+
//! pq_updates pq([&](int id) {
8+
//! hist.push_back(uf.time());
9+
//! uf.join(updates[id].first, updates[id].second);
10+
//! }, [&]() {
11+
//! uf.rollback(hist.back());
12+
//! hist.pop_back();
13+
//! });
714
//! updates.push_back({u, v});
815
//! pq.push(pri, ssize(updates) - 1);
916
//! @endcode

0 commit comments

Comments
 (0)