結果

問題 No.1238 選抜クラス
ユーザー playrollerplayroller
提出日時 2021-04-03 18:39:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,087 bytes
コンパイル時間 1,899 ms
コンパイル使用メモリ 172,840 KB
実行使用メモリ 409,920 KB
最終ジャッジ日時 2023-08-26 14:06:12
合計ジャッジ時間 13,424 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 7 ms
7,500 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 4 ms
5,460 KB
testcase_08 AC 7 ms
7,580 KB
testcase_09 AC 14 ms
12,592 KB
testcase_10 AC 5 ms
5,880 KB
testcase_11 AC 11 ms
11,536 KB
testcase_12 AC 8 ms
8,316 KB
testcase_13 AC 8 ms
8,376 KB
testcase_14 AC 7 ms
7,504 KB
testcase_15 AC 13 ms
12,520 KB
testcase_16 AC 12 ms
11,448 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 547 ms
393,960 KB
testcase_20 WA -
testcase_21 AC 483 ms
348,328 KB
testcase_22 WA -
testcase_23 AC 573 ms
409,820 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 580 ms
409,840 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 54 ms
42,424 KB
testcase_31 WA -
testcase_32 AC 346 ms
246,388 KB
testcase_33 AC 5 ms
5,352 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 22 ms
18,024 KB
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
 
#define rep(i,j,n) for(int i=j;i<n;++i)
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(), i.rend()
#define INF 1e9
#define LINF 1e18
const int mod = 998244353;
 
typedef long long i64;
typedef pair<int, int> pi;
 
template <class T> using vt = vector<T>;
template <class T> using vvt = vector<vector<T>>;
 
i64 gcd(i64 n, i64 m) {return (m == 0? n : gcd(m, n % m));}
i64 lcm(i64 n, i64 m) {return (n / gcd(n, m) * m);}
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n, K;
  cin >> n >> K;
  vt<int> a(n);
  rep(i, 0, n) {
    cin >> a[i];
  }

  vvt<vt<int>> dp(n + 1, vvt<int>(n + 1, vt<int>(10100, 0)));
  dp[0][0][0] = 1;
  rep(i, 0, n) {
    rep(j, 0, n) {
      rep(k, 0, 10000) {
        (dp[i + 1][j + 1][k + a[i]] += dp[i][j][k]) %= mod;
        (dp[i + 1][j][k] += dp[i][j][k]) %= mod;
      }
    }
  }

  int ans = 0;
  rep(i, 1, n + 1) {
    rep(j, 0, 10010) {
      if(j >= i * K) (ans += dp[n][i][j]) %= mod;
    }
  }
  cout << ans << endl;
}
0