Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ When adding or editing code here, optimize for contest usage first.
- Prefer `ll` by default to reduce overflow debugging.
- Use `int` only when clearly safe and beneficial (memory, bitset indexing, array indices, tight constraints).
- Avoid implicit narrowing conversions. Cast explicitly at boundaries when mixing types.
- Prefer aliases from `common.hpp` (e.g., `pll`, `pii`) when they match exactly to reduce typing.
- Always use aliases from `common.hpp` (e.g., `pll`, `pii`) when they match exactly to reduce typing.

## Coding rules
- Prefer straightforward implementations over heavy abstractions.
Expand Down
5 changes: 5 additions & 0 deletions src/1-ds/erasable_pq.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#include "../common/common.hpp"
// Erasable priority queue (lazy deletion).
// what: priority_queue with erase by value (multiset-like)
// time: push/pop/erase amortized O(log n), top O(1) amortized, memory: O(n)
// constraint: erase only existing values, duplicates ok
// usage: erasable_pq<ll> pq; pq.push(x); pq.erase(x); ll v = pq.top(); pq.pop();
template <class T, class O = less<T>>
struct pq_set {
priority_queue<T, vector<T>, O> q, del;
Expand Down