Skip to content

Commit

Permalink
Bell Number test
Browse files Browse the repository at this point in the history
  • Loading branch information
adamant-pwn committed Nov 11, 2024
1 parent e42bc85 commit 4a57282
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions verify/poly/bell.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// @brief Bell Number
#define PROBLEM "https://judge.yosupo.jp/problem/bell_number"
#pragma GCC optimize("Ofast,unroll-loops")
#include "cp-algo/math/poly.hpp"
#include <bits/stdc++.h>

using namespace std;
using namespace cp_algo::math;

const int mod = 998244353;
using base = modint<mod>;
using polyn = poly_t<base>;

void solve() {
int n;
cin >> n;
(polyn::expx(n+1) - polyn(1)).exp_inplace(n+1).invborel().print(n+1);
}

signed main() {
//freopen("input.txt", "r", stdin);
ios::sync_with_stdio(0);
cin.tie(0);
int t = 1;
while(t--) {
solve();
}
}

0 comments on commit 4a57282

Please sign in to comment.