icpc-snippet

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub EarthMessenger/icpc-snippet

:heavy_check_mark: verify/math/bitwise_xor_convolution.test.cpp

Depends on

Code

#define PROBLEM "https://judge.yosupo.jp/problem/bitwise_xor_convolution"

#include "lib/math/convolution.hpp"
#include "lib/math/static_modint.hpp"

signed main() 
{
    using namespace std;
    ios::sync_with_stdio(false); 
    cin.tie(0), cout.tie(0);
    auto read_int = [x = int()]() mutable { return cin >> x, x; };
    u32 n = read_int(), q = 1 << n;
    using mint = static_modint<998244353>;
    vec<mint> a(q), b(q);
    for (auto &i: a) i = read_int();
    for (auto &i: b) i = read_int();
    auto base = []([[maybe_unused]] u32 h) { return mint::raw(1); };
    auto inv = [inv2 = mint(q).inv()](mint &x, [[maybe_unused]] u32 m) { x *= inv2; };
    poly::fourier_transform<0>(n, a, base, inv, mint(1));
    poly::fourier_transform<0>(n, b, base, inv, mint(1));
    for (u32 i = 0; i < q; i++) a[i] *= b[i];
    poly::fourier_transform<1>(n, a, base, inv, mint(1));
    for (auto i: a) cout << i.val() << ' ';
    return 0;
}
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.10/site-packages/onlinejudge_verify/documentation/build.py", line 71, in _render_source_code_stat
    bundled_code = language.bundle(stat.path, basedir=basedir, options={'include_paths': [basedir]}).decode()
  File "/home/runner/.local/lib/python3.10/site-packages/onlinejudge_verify/languages/cplusplus.py", line 187, in bundle
    bundler.update(path)
  File "/home/runner/.local/lib/python3.10/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py", line 401, in update
    self.update(self._resolve(pathlib.Path(included), included_from=path))
  File "/home/runner/.local/lib/python3.10/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py", line 312, in update
    raise BundleErrorAt(path, i + 1, "#pragma once found in a non-first line")
onlinejudge_verify.languages.cplusplus_bundle.BundleErrorAt: lib/math/convolution.hpp: line 4: #pragma once found in a non-first line
Back to top page