結果
| 問題 |
No.840 ほむほむほむら
|
| コンテスト | |
| ユーザー |
tempura_pp
|
| 提出日時 | 2019-06-12 03:20:44 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 539 bytes |
| コンパイル時間 | 767 ms |
| コンパイル使用メモリ | 64,640 KB |
| 実行使用メモリ | 344,284 KB |
| 最終ジャッジ日時 | 2024-10-08 07:23:02 |
| 合計ジャッジ時間 | 9,181 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 RE * 1 |
| other | WA * 18 RE * 7 |
ソースコード
#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+1][j][k][l];
dp[i+1][j][(j+k)%t][l]+=dp[i+1][j][k][l];
dp[i+1][(j+1)%t][k][l]+=dp[i+1][j][k][l];
}
cout<<dp[n][0][0][0]%mod<<endl;
return 0;
}
tempura_pp