結果
| 問題 |
No.2528 pop_(backfront or not)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-03 21:34:01 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 22 ms / 2,000 ms |
| コード長 | 784 bytes |
| コンパイル時間 | 2,262 ms |
| コンパイル使用メモリ | 166,360 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-25 19:28:20 |
| 合計ジャッジ時間 | 3,053 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int p=998244353;
const int maxn=4005;
int res[maxn];int res2[maxn];
int32_t main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int n;cin>>n;res[1]=1;
for(int i=1;i<=n;++i)
{
fill(res2,res2+maxn,0);
for(int j=1;j<=2*i+1;++j)
{
if(j!=1 && j!=(2*i+1)) {res2[j]+=res[j-1];}
if(j!=1 && j!=(2*i+1))
{
res2[j]+=res[j-1]*(j-2)*(2*i-j);
}
if(j!=1) res2[j]+=res[j-2]*((j-2)*(j-3)/2);
if(j!=(2*i+1)) res2[j]+=res[j]*(2*i-j)*(2*i-j-1)/2;
res2[j]%=p;
}
copy(res2,res2+maxn,res);
}
for(int i=1;i<=2*n+1;++i) cout<<res[i]<<'\n';
return 0;
}