diff options
| author | Gloria Mundi <gloria@gloria-mundi.eu> | 2024-11-16 01:24:14 +0100 |
|---|---|---|
| committer | Gloria Mundi <gloria@gloria-mundi.eu> | 2024-11-16 01:24:14 +0100 |
| commit | 98567ec798aa8ca2cfbcb85c774dd470f30e30d4 (patch) | |
| tree | 5113d5cc24d1ad5f93810b6442ce584a36950dc8 /math/transforms/ntt.cpp | |
| parent | ad3856a6b766087df0036de0b556f4700a6498c9 (diff) | |
| parent | 8d11c6c8213f46f0fa19826917c255edd5d43cb1 (diff) | |
mzuenni tests
Diffstat (limited to 'math/transforms/ntt.cpp')
| -rw-r--r-- | math/transforms/ntt.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/math/transforms/ntt.cpp b/math/transforms/ntt.cpp deleted file mode 100644 index ca605d3..0000000 --- a/math/transforms/ntt.cpp +++ /dev/null @@ -1,23 +0,0 @@ -constexpr ll mod = 998244353, root = 3; - -void ntt(vector<ll>& a, bool inv = false) { - int n = sz(a); - auto b = a; - ll r = inv ? powMod(root, mod - 2, mod) : root; - - for (int s = n / 2; s > 0; s /= 2) { - ll ws = powMod(r, (mod - 1) / (n / s), mod), w = 1; - for (int j = 0; j < n / 2; j += s) { - for (int k = j; k < j + s; k++) { - ll u = a[j + k], t = a[j + s + k] * w % mod; - b[k] = (u + t) % mod; - b[n/2 + k] = (u - t + mod) % mod; - } - w = w * ws % mod; - } - swap(a, b); - } - if (inv) { - ll div = powMod(n, mod - 2, mod); - for (auto& x : a) x = x * div % mod; -}} |
