This documentation is automatically generated by competitive-verifier/competitive-verifier
// competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/bitwise_xor_convolution
#include <iostream>
#include <vector>
#include "math/modint.hpp"
using Mint = modint998;
template <typename T>
void fwt(std::vector<T> &f) {
int n = f.size();
for (int i = 1; i < n; i <<= 1) {
for (int j = 0; j < n; j++) {
if ((j & i) == 0) {
T x = f[j], y = f[j | i];
f[j] = x + y, f[j | i] = x - y;
}
}
}
}
template <typename T>
void ifwt(std::vector<T> &f) {
int n = f.size();
for (int i = 1; i < n; i <<= 1) {
for (int j = 0; j < n; j++) {
if ((j & i) == 0) {
T x = f[j], y = f[j | i];
f[j] = (x + y) / 2, f[j | i] = (x - y) / 2;
}
}
}
}
int main(void) {
int n;
std::cin >> n;
n = 1 << n;
std::vector<Mint> a(n), b(n);
for (auto &e : a) std::cin >> e;
for (auto &e : b) std::cin >> e;
fwt(a), fwt(b);
std::vector<Mint> c(n);
for (int i = 0; i < n; ++i) c[i] = a[i] * b[i];
ifwt(c);
for (int i = 0; i < n; ++i) std::cout << c[i] << (i == n - 1 ? '\n' : ' ');
return 0;
}
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/resolver.py", line 291, in resolve
bundled_code = language.bundle(path, basedir=basedir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus.py", line 242, in bundle
bundler.update(path)
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 479, in update
self._resolve(pathlib.Path(included), included_from=path)
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 286, in _resolve
raise BundleErrorAt(path, -1, "no such header")
competitive_verifier.oj.verify.languages.cplusplus_bundle.BundleErrorAt: math/modint.hpp: line -1: no such header
| Env | Name | Status | Elapsed | Memory |
|---|---|---|---|---|
| g++ | example_00 |
|
3 ms | 4 MB |
| g++ | large_00 |
|
81 ms | 4 MB |
| g++ | large_01 |
|
167 ms | 4 MB |
| g++ | large_02 |
|
720 ms | 6 MB |
| g++ | max_random_00 |
|
3127 ms | 15 MB |
| g++ | max_random_01 |
|
3121 ms | 15 MB |
| g++ | max_random_02 |
|
3112 ms | 15 MB |
| g++ | small_00 |
|
3 ms | 3 MB |
| g++ | small_01 |
|
2 ms | 4 MB |
| g++ | small_02 |
|
3 ms | 4 MB |
| g++ | tiny_00 |
|
2 ms | 4 MB |
| g++ | tiny_01 |
|
2 ms | 3 MB |
| g++ | tiny_02 |
|
2 ms | 3 MB |