結果

問題 No.2329 Nafmo、イカサマをする
ユーザー srpkdyysrpkdyy
提出日時 2023-05-28 15:57:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 854 bytes
コンパイル時間 4,231 ms
コンパイル使用メモリ 232,124 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-27 13:27:59
合計ジャッジ時間 5,225 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 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 1 ms
4,380 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
4,376 KB
testcase_14 WA -
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 1 ms
4,380 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 2 ms
4,376 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, n) for (int i=0; i<(n); i++)
#define len(x) (int)(x).size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
using namespace std;
using namespace atcoder;
using ll = long long;
using mint9 = atcoder::modint998244353;
using mint10 = atcoder::modint1000000007;

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

   ll N, M, K;
   cin >> N >> M >> K;
   vector<ll> A(N);
   rep(i, N) cin >> A[i];
   sort(all(A));

   vector<vector<ll>> dp(K, vector<ll>(N));
   rep(i, N) dp[0][i] = A[i];

   for (int k=1; k<K; k++) {
      rep(i, N) {
         rep(j, N) {
            if (A[i] + dp[k-1][j] <= M) {
               dp[k][i] = max(dp[k][i], A[i] + dp[k-1][j]);
            }
         }
      }
   }
   cout << *max_element(all(dp[K-1])) << endl;
   return 0;
}

0