結果
問題 |
No.840 ほむほむほむら
|
ユーザー |
![]() |
提出日時 | 2019-06-12 03:21:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 533 bytes |
コンパイル時間 | 730 ms |
コンパイル使用メモリ | 65,740 KB |
実行使用メモリ | 344,260 KB |
最終ジャッジ日時 | 2024-10-08 07:31:34 |
合計ジャッジ時間 | 16,694 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | WA * 15 RE * 3 TLE * 1 -- * 6 |
ソースコード
#include<iostream> using namespace std; #define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i ) #define rep(i,n) REP(i,0,n) using ll = long long; const ll mod=998244353 ; ll dp[202020][6][6][6]; int main(){ int n,t; cin>>n>>t; dp[0][0][0][0]=1; rep(i,n)rep(j,t)rep(k,t)rep(l,t){ dp[i][j][k][l]%=mod; dp[i+1][j][k][(k+l)%t]+=dp[i][j][k][l]; dp[i+1][j][(j+k)%t][l]+=dp[i][j][k][l]; dp[i+1][(j+1)%t][k][l]+=dp[i][j][k][l]; } cout<<dp[n][0][0][0]%mod<<endl; return 0; }