cp-library

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

View the Project on GitHub qandori/cp-library

:heavy_check_mark: test/comb_light.test.cpp

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

検証問題

依存ライブラリ

コード

#define PROBLEM "https://yukicoder.me/problems/no/3172"
#define COMB_MAX 200000
#include "../math/comb_light.hpp"
#include <iostream>

int main() {
	std::cin.tie(nullptr)->sync_with_stdio(false);
	int n;
	std::cin >> n;
	for (int k = 0; k <= n; ++k)
		std::cout << ((n - k) % 2 ? mint(0) : light_combinatorics::comb(n, (n - k) / 2) * (k ? 2 : 1)) << (k == n ? '\n' : ' ');
}
Back to top page