diff options
| author | Gloria Mundi <gloria@gloria-mundi.eu> | 2024-03-10 20:43:13 +0100 |
|---|---|---|
| committer | Gloria Mundi <gloria@gloria-mundi.eu> | 2024-03-10 20:43:13 +0100 |
| commit | 0cebc901e79c21168601071e29ed8e4f4b6f9505 (patch) | |
| tree | d917fc4bb1ecedb1794f09ded08c478b0be301dd /test.h | |
| parent | 0f29ac59c2bf0e5eafc2a6fa436e3070085e3a1d (diff) | |
add tests for Fenwick Tree
Diffstat (limited to 'test.h')
| -rw-r--r-- | test.h | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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<int>(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); +} + +} |
