結果

問題 No.2391 SAN 値チェック
ユーザー 遭難者遭難者
提出日時 2023-07-21 23:12:39
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 895 bytes
コンパイル時間 8,198 ms
コンパイル使用メモリ 342,396 KB
実行使用メモリ 4,532 KB
最終ジャッジ日時 2023-10-21 23:13:50
合計ジャッジ時間 8,635 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,528 KB
testcase_01 AC 4 ms
4,528 KB
testcase_02 AC 3 ms
4,528 KB
testcase_03 WA -
testcase_04 AC 15 ms
4,532 KB
testcase_05 WA -
testcase_06 AC 12 ms
4,532 KB
testcase_07 AC 13 ms
4,532 KB
testcase_08 AC 9 ms
4,532 KB
testcase_09 AC 11 ms
4,532 KB
testcase_10 WA -
testcase_11 AC 4 ms
4,532 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifndef DEBUG
#pragma GCC target("avx2")
#pragma GCC optimize("Ofast,unroll-loops")
#endif
#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(a) a.begin(), a.end()
#define vc vector
#define ll long long
using namespace std;
using namespace atcoder;
using mint = modint998244353;
constexpr int INF = 1e5 + 2023;
mint fac[INF + 1];
mint fin[INF + 1];
void solve()
{
	fac[0] = 1;
	for (int i = 1; i <= INF; i++)
		fac[i] = i * fac[i - 1];
	fin[INF] = fac[INF].inv();
	for (int i = INF; i > 0; i--)
		fin[i - 1] = i * fin[i];
	int n;
	cin >> n;
	for (int i = 0; i <= n; i++)
	{
		mint ans = mint(i).pow(n - i) * fin[n - i];
		if ((n - i) % 2)
			ans *= -1;
		cout << ans.val() << '\n';
	}
}
int main()
{
	// srand((unsigned)time(NULL));
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(13);
	solve();
	return 0;
}
0