From 8da20a3d1a47a4d36c4fa8d6048b96f3069202c9 Mon Sep 17 00:00:00 2001 From: Yukkku Date: Mon, 3 Jul 2023 16:25:50 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AA=E3=82=A4=E3=83=A9=E3=83=BC=E3=83=84?= =?UTF-8?q?=E3=82=A2=E3=83=BC=E3=81=AA=E3=82=89=E5=8C=BA=E9=96=93=E3=81=8C?= =?UTF-8?q?=E5=8F=96=E5=BE=97=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84=E3=81=A8?= =?UTF-8?q?=E3=81=A0=E3=82=81=E3=81=A0=E3=82=8D=E3=81=A3=E3=81=A6=E6=80=9D?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- euler_tour/main.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/euler_tour/main.ts b/euler_tour/main.ts index bf80907..df07691 100644 --- a/euler_tour/main.ts +++ b/euler_tour/main.ts @@ -87,6 +87,15 @@ export class EulerTour { return this.#cost[v]; } + /** + * 頂点に対応する区間を返す + * @param v 対象の頂点 + * @returns [`retVal[0]`, `retVal[1]`)の形の半開区間 + */ + range (v: number): [number, number] { + return [this.#l[v], this.#r[v]]; + } + *[Symbol.iterator]() { for (const v of this.#data) { yield v;