結果

問題 No.2944 Sigma Partition Problem
ユーザー kazuppakazuppa
提出日時 2024-09-29 12:47:42
言語 C++23(gcc13)
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 163 ms / 4,000 ms
コード長 493 bytes
コンパイル時間 7,331 ms
コンパイル使用メモリ 336,688 KB
実行使用メモリ 66,176 KB
最終ジャッジ日時 2024-10-08 23:16:19
合計ジャッジ時間 11,866 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 162 ms
66,048 KB
testcase_01 AC 160 ms
65,920 KB
testcase_02 AC 162 ms
66,048 KB
testcase_03 AC 160 ms
65,920 KB
testcase_04 AC 160 ms
66,048 KB
testcase_05 AC 161 ms
66,176 KB
testcase_06 AC 162 ms
66,048 KB
testcase_07 AC 162 ms
66,048 KB
testcase_08 AC 163 ms
65,920 KB
testcase_09 AC 160 ms
65,920 KB
testcase_10 AC 159 ms
65,920 KB
testcase_11 AC 160 ms
66,048 KB
testcase_12 AC 159 ms
65,920 KB
testcase_13 AC 160 ms
65,920 KB
testcase_14 AC 158 ms
66,176 KB
testcase_15 AC 161 ms
65,920 KB
testcase_16 AC 161 ms
66,048 KB
testcase_17 AC 159 ms
65,920 KB
testcase_18 AC 159 ms
65,920 KB
testcase_19 AC 160 ms
65,920 KB
testcase_20 AC 160 ms
66,048 KB
testcase_21 AC 160 ms
65,920 KB
testcase_22 AC 162 ms
66,048 KB
testcase_23 AC 162 ms
65,920 KB
testcase_24 AC 162 ms
65,920 KB
testcase_25 AC 161 ms
66,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#include <atcoder/all>
using namespace atcoder;
using mint=modint998244353;

int main() {
  int m=4000;
  vector<vector<mint>> dp(m+1,vector<mint>(m+1,0));
  for(int i=0;i<=m;i++)dp[0][i]=1;
  for(int i=0;i<=m;i++)
    for(int j=0;j<=m;j++){
      mint e=0;
      if(j<=i)e+=dp[i-j][j];
      dp[i][j]=dp[i][j-1]+e;
    }
  int q;cin>>q;
  for(int i=0;i<q;i++){
    int t,n,k;cin>>t>>n>>k;
    cout<<dp[n][k].val()<<endl;
  }
}
0