結果

問題 No.3182 recurrence relation’s intersection sum
ユーザー ooaiu
提出日時 2025-07-28 10:14:51
言語 cLay
(20241019-1)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 3,795 ms
コンパイル使用メモリ 193,252 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-07-28 10:15:04
合計ジャッジ時間 12,204 ms
ジャッジサーバーID
(参考情報)
judge3 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

#define MD 998244353
ll@K,@L--,@R;
L>?=0;
Matrix<Mint>A(K+4,K+4);
Mint B[K+4];
rep(i,K+1){
A[i][0]=A[i][i]=1;
rep(j,1,i)A[i][j]=A[i-1][j]+A[i-1][j-1];
}
A[K+1][K+1]=A[K+2][K+2]=A[K+3][K+1]=K;
A[K+1][K]=A[K+1][K+2]=A[K+3][K+3]=A[K+3][K]=A[K+3][K+2]=B[0]=B[K+1]=B[K+2]=B[K+3]=1;
auto C=A**R;
if(L)C-=A**L;
Mint ans=0;
rep(i,K+4)ans+=C[K+3][i]*B[i];
wt(ans);
0