結果
問題 | No.2872 Depth of the Parentheses |
ユーザー |
![]() |
提出日時 | 2024-05-03 15:37:02 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 432 bytes |
コンパイル時間 | 4,210 ms |
コンパイル使用メモリ | 231,252 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-06 20:50:07 |
合計ジャッジ時間 | 5,637 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 7 WA * 18 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using mint = modint998244353; int main() { int x, K; cin >> x >> K; mint p = mint(x) / 100; mint fact[2*K+1]; for (int i = 0; i <= 2*K; i++) fact[i] = (i) ? fact[i-1] * i : 1; mint ans = 0; for (int i = 1; i <= K; i++) ans += fact[2*i] / fact[i] / fact[i+1]; ans *= p.pow(K) * (1-p).pow(K); cout << ans.val() << endl; }