From 0cebc901e79c21168601071e29ed8e4f4b6f9505 Mon Sep 17 00:00:00 2001 From: Gloria Mundi Date: Sun, 10 Mar 2024 20:43:13 +0100 Subject: add tests for Fenwick Tree --- test.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test.h') diff --git a/test.h b/test.h index cca2243..ce2689f 100644 --- a/test.h +++ b/test.h @@ -11,3 +11,23 @@ T _lg_check(T n) { } #define __lg _lg_check + +namespace util { + +mt19937 rd(0); + +int randint(int l, int r) { + assert(l <= r); + return uniform_int_distribution(l, r)(rd); +} + +int randint(int x) { + assert(x > 0); + return randint(0, x-1); +} + +int randint() { + return randint(-1'000'000, +1'000'000); +} + +} -- cgit v1.2.3