ac-library

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

View the Project on GitHub habara-k/ac-library

:heavy_check_mark: test/bitwise_or_convolution.test.cpp

Depends on

Code

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

#include <atcoder/modint>
#include <atcoder/kronecker_power_transform>
#include <iostream>
#include <vector>

using namespace atcoder;
using namespace std;

int main() {
    int n; cin >> n;
    using mint = modint998244353;
    std::vector<mint> a(1<<n), b(1<<n);
    for (int i = 0; i < 1<<n; i++) {
        int x; cin >> x; a[i] = x;
    }
    for (int i = 0; i < 1<<n; i++) {
        int x; cin >> x; b[i] = x;
    }
    reverse(a.begin(), a.end());
    reverse(b.begin(), b.end());
    bitwise_or_convolution(a, b);
    reverse(a.begin(), a.end());
    for (int i = 0; i < 1<<n; i++) {
        cout << a[i].val() << ' ';
    }
    cout << '\n';
}
#line 1 "test/bitwise_or_convolution.test.cpp"
#define PROBLEM "https://judge.yosupo.jp/problem/bitwise_and_convolution"

#include <atcoder/modint>
#include <atcoder/kronecker_power_transform>
#include <iostream>
#include <vector>

using namespace atcoder;
using namespace std;

int main() {
    int n; cin >> n;
    using mint = modint998244353;
    std::vector<mint> a(1<<n), b(1<<n);
    for (int i = 0; i < 1<<n; i++) {
        int x; cin >> x; a[i] = x;
    }
    for (int i = 0; i < 1<<n; i++) {
        int x; cin >> x; b[i] = x;
    }
    reverse(a.begin(), a.end());
    reverse(b.begin(), b.end());
    bitwise_or_convolution(a, b);
    reverse(a.begin(), a.end());
    for (int i = 0; i < 1<<n; i++) {
        cout << a[i].val() << ' ';
    }
    cout << '\n';
}
Back to top page