結果

問題 No.3182 recurrence relation’s intersection sum
ユーザー ooaiu
提出日時 2025-07-28 10:19:30
言語 cLay
(20241019-1)
結果
AC  
実行時間 434 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 3,675 ms
コンパイル使用メモリ 193,220 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-07-28 10:19:42
合計ジャッジ時間 11,359 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

#define MD 998244353
ll@K,@L,@R;
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