Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitddc6652

Browse files
committed
add dynamic_modint test for many_facts
1 parent97dc6d9 commitddc6652

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
File renamed without changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// @brief Many Factorials (dynamic Mod)
2+
#definePROBLEM"https://judge.yosupo.jp/problem/many_factorials"
3+
#pragma GCC optimize("Ofast,unroll-loops")
4+
#defineCP_ALGO_CHECKPOINT
5+
#include<bits/stdc++.h>
6+
#include"blazingio/blazingio.min.hpp"
7+
#include"cp-algo/math/factorials.hpp"
8+
9+
usingnamespacestd;
10+
using base = cp_algo::math::dynamic_modint<>;
11+
12+
voidsolve() {
13+
int n;
14+
cin >> n;
15+
base::switch_mod(998'244'353);
16+
vector<base>args(n);
17+
for(auto &x : args) {cin >> x;}
18+
cp_algo::checkpoint("read");
19+
auto res = facts<true,100'000>(args);
20+
for(auto it: res) {cout << it <<"\n";}
21+
cp_algo::checkpoint("write");
22+
cp_algo::checkpoint<1>();
23+
}
24+
25+
signedmain() {
26+
//freopen("input.txt", "r", stdin);
27+
ios::sync_with_stdio(0);
28+
cin.tie(0);
29+
int t =1;
30+
//cin >> t;
31+
while(t--) {
32+
solve();
33+
}
34+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp