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/subset_convolution.test.cpp

Depends on

Code

#define PROBLEM "https://judge.yosupo.jp/problem/subset_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);
    using mint = static_modint<998244353>;
    auto read_int = [x = int()]() mutable { return cin >> x, x; };
    u32 n = read_int(), q = 1 << n;
    vec<vec<mint>> a(n + 1, vec<mint>(q)), b(a), c(a);
    for (u32 i = 0; i < q; i++) a[__builtin_popcount(i)][i] = read_int();
    for (u32 i = 0; i < q; i++) b[__builtin_popcount(i)][i] = read_int();
    for (auto &i: a) poly::bit::sosdp<0>(n, i);
    for (auto &i: b) poly::bit::sosdp<0>(n, i);
    for (u32 i = 0; i <= n; i++) {
        for (u32 j = 0; j <= i; j++) {
            for (u32 k = 0; k < q; k++) {
                c[i][k] += a[j][k] * b[i - j][k];
            }
        }
    }
    for (auto &i: c) poly::bit::sosdp<1>(n, i);
    for (u32 i = 0; i < q; i++) {
        cout << c[__builtin_popcount(i)][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