Skip to content

Commit ddc6652

Browse files
committed
add dynamic_modint test for many_facts
1 parent 97dc6d9 commit ddc6652

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+
#define PROBLEM "https://judge.yosupo.jp/problem/many_factorials"
3+
#pragma GCC optimize("Ofast,unroll-loops")
4+
#define CP_ALGO_CHECKPOINT
5+
#include <bits/stdc++.h>
6+
#include "blazingio/blazingio.min.hpp"
7+
#include "cp-algo/math/factorials.hpp"
8+
9+
using namespace std;
10+
using base = cp_algo::math::dynamic_modint<>;
11+
12+
void solve() {
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+
signed main() {
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)