CP-Algorithms Library

This documentation is automatically generated by competitive-verifier/competitive-verifier

View the Project on GitHub cp-algorithms/cp-algorithms-aux

:heavy_check_mark: Bitwise And Convolution (verify/math/and_convolution.test.cpp)

Depends on

Code

// @brief Bitwise And Convolution
#define PROBLEM "https://judge.yosupo.jp/problem/bitwise_and_convolution"
#pragma GCC optimize("O3,unroll-loops")
#include <bits/allocator.h>
#pragma GCC target("avx2")
#include <iostream>
#include "blazingio/blazingio.min.hpp"
#define CP_ALGO_CHECKPOINT
#include "cp-algo/number_theory/modint.hpp"
#include "cp-algo/util/big_alloc.hpp"
#include "cp-algo/util/checkpoint.hpp"
#include "cp-algo/math/and_convolution.hpp"
#include <bits/stdc++.h>

using namespace std;

const int mod = 998244353;
using base = cp_algo::math::modint<mod>;

void solve() {
    uint32_t n;
    cin >> n;
    uint32_t N = 1u << n;
    cp_algo::big_vector<base> a(N), b(N);
    for (auto &it : a) {cin >> it;}
    for (auto &it : b) {cin >> it;}
    cp_algo::checkpoint("read");
    cp_algo::math::and_convolution_inplace(a, b);
    for (auto it : a) {cout << it << ' ';}
    cp_algo::checkpoint("write");
    cp_algo::checkpoint<1>();
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    while (t--) {
        solve();
    }
}
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj_resolve/resolver.py", line 181, 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 252, in bundle
    bundler.update(path)
  File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 327, in update
    assert len(lines) == len(uncommented_lines)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Test cases

Env Name Status Elapsed Memory
g++ example_00 :heavy_check_mark: AC 5 ms 6 MB
g++ max_random_00 :heavy_check_mark: AC 57 ms 43 MB
g++ max_random_01 :heavy_check_mark: AC 55 ms 43 MB
g++ max_random_02 :heavy_check_mark: AC 55 ms 43 MB
g++ random_00 :heavy_check_mark: AC 7 ms 7 MB
g++ random_01 :heavy_check_mark: AC 8 ms 8 MB
g++ random_02 :heavy_check_mark: AC 19 ms 15 MB
g++ small_00 :heavy_check_mark: AC 5 ms 6 MB
g++ small_01 :heavy_check_mark: AC 5 ms 6 MB
g++ small_02 :heavy_check_mark: AC 5 ms 6 MB
g++ tiny_00 :heavy_check_mark: AC 5 ms 6 MB
g++ tiny_01 :heavy_check_mark: AC 5 ms 6 MB
g++ tiny_02 :heavy_check_mark: AC 5 ms 6 MB
Back to top page