結果
| 問題 |
No.3146 RE: Parentheses Counting
|
| コンテスト | |
| ユーザー |
👑 potato167
|
| 提出日時 | 2025-05-16 22:33:29 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 607 bytes |
| コンパイル時間 | 2,310 ms |
| コンパイル使用メモリ | 195,432 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-05-16 22:33:44 |
| 合計ジャッジ時間 | 14,899 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 43 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define all(p) p.begin(), p.end()
#define rep(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#include<atcoder/modint>
using mint = atcoder::modint998244353;
int main(){
int T;
cin >> T;
const int L = 500'500;
vector<mint> ans(L);
mint fac2 = 1, fac = 1;
rep(i, 1, L){
fac2 *= 2 * i;
fac2 *= 2 * i - 1;
fac *= i;
ans[i + 1] = fac2 / (fac * fac * (i + 1));
}
while (T--){
int N;
cin >> N;
if (N & 1) cout << "0\n";
else cout << ans[N / 2].val() << "\n";
}
}
potato167