From 08786755e03784b2d8c2d6a07f6cf673676ae611 Mon Sep 17 00:00:00 2001 From: manoflearning <77jwk0724@gmail.com> Date: Wed, 31 Dec 2025 17:20:11 +0900 Subject: [PATCH 1/2] change AGENTS.md --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index ec31b50..e6ccb2b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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. From 2a555d7107a0d522bc2ad706f9275eb488242f12 Mon Sep 17 00:00:00 2001 From: manoflearning <77jwk0724@gmail.com> Date: Wed, 31 Dec 2025 17:22:44 +0900 Subject: [PATCH 2/2] epq --- src/1-ds/erasable_pq.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/1-ds/erasable_pq.cpp b/src/1-ds/erasable_pq.cpp index 4b148c6..023d212 100644 --- a/src/1-ds/erasable_pq.cpp +++ b/src/1-ds/erasable_pq.cpp @@ -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 pq; pq.push(x); pq.erase(x); ll v = pq.top(); pq.pop(); template > struct pq_set { priority_queue, O> q, del;