We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e42bc85 commit 4a57282Copy full SHA for 4a57282
verify/poly/bell.test.cpp
@@ -0,0 +1,28 @@
1
+// @brief Bell Number
2
+#define PROBLEM "https://judge.yosupo.jp/problem/bell_number"
3
+#pragma GCC optimize("Ofast,unroll-loops")
4
+#include "cp-algo/math/poly.hpp"
5
+#include <bits/stdc++.h>
6
+
7
+using namespace std;
8
+using namespace cp_algo::math;
9
10
+const int mod = 998244353;
11
+using base = modint<mod>;
12
+using polyn = poly_t<base>;
13
14
+void solve() {
15
+ int n;
16
+ cin >> n;
17
+ (polyn::expx(n+1) - polyn(1)).exp_inplace(n+1).invborel().print(n+1);
18
+}
19
20
+signed main() {
21
+ //freopen("input.txt", "r", stdin);
22
+ ios::sync_with_stdio(0);
23
+ cin.tie(0);
24
+ int t = 1;
25
+ while(t--) {
26
+ solve();
27
+ }
28
0 commit comments