cp-library

競技プログラミング用 C++ ライブラリ

View the Project on GitHub qandori/cp-library

:heavy_check_mark: test/multiplicative_convolution_light.test.cpp

test/multiplicative_convolution_light.test.cpp · GitHub で見る

検証問題

依存ライブラリ

コード

#define PROBLEM "https://judge.yosupo.jp/problem/mul_modp_convolution"
#include "../convolution/multiplicative_convolution_light.hpp"
#include "../math/mint.hpp"
#include <iostream>
#include <vector>

int main() {
	std::cin.tie(nullptr)->sync_with_stdio(false);
	int n;
	std::cin >> n;
	std::vector<mint> a(n), b(n);
	for (auto &x : a) std::cin >> x;
	for (auto &x : b) std::cin >> x;
	for (auto x : light_convolution::multiplicative_convolution(a, b)) std::cout << x << ' ';
	std::cout << '\n';
}
Back to top page