結果

問題 No.2701 A cans -> B cans
ユーザー eve__fuyukieve__fuyuki
提出日時 2024-04-01 09:39:29
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 725 bytes
コンパイル時間 2,329 ms
コンパイル使用メモリ 207,664 KB
実行使用メモリ 199,040 KB
最終ジャッジ日時 2024-04-01 09:40:03
合計ジャッジ時間 33,370 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 3 ms
6,676 KB
testcase_06 AC 3 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 3 ms
6,676 KB
testcase_10 AC 3 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 3 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 AC 2 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 2 ms
6,676 KB
testcase_21 AC 2 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 609 ms
199,040 KB
testcase_24 AC 577 ms
199,040 KB
testcase_25 AC 603 ms
199,040 KB
testcase_26 AC 585 ms
199,040 KB
testcase_27 AC 608 ms
199,040 KB
testcase_28 AC 592 ms
199,040 KB
testcase_29 AC 650 ms
199,040 KB
testcase_30 AC 605 ms
199,040 KB
testcase_31 AC 611 ms
199,040 KB
testcase_32 AC 603 ms
199,040 KB
testcase_33 AC 619 ms
199,040 KB
testcase_34 AC 593 ms
199,040 KB
testcase_35 AC 633 ms
199,040 KB
testcase_36 AC 597 ms
199,040 KB
testcase_37 AC 624 ms
199,040 KB
testcase_38 AC 614 ms
199,040 KB
testcase_39 WA -
testcase_40 AC 590 ms
199,040 KB
testcase_41 AC 607 ms
199,040 KB
testcase_42 WA -
testcase_43 AC 600 ms
199,040 KB
testcase_44 AC 596 ms
199,040 KB
testcase_45 AC 616 ms
199,040 KB
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
testcase_64 WA -
testcase_65 WA -
testcase_66 AC 641 ms
199,040 KB
testcase_67 AC 623 ms
199,040 KB
testcase_68 AC 636 ms
199,040 KB
testcase_69 AC 612 ms
199,040 KB
testcase_70 AC 639 ms
199,040 KB
testcase_71 AC 609 ms
199,040 KB
testcase_72 AC 631 ms
199,040 KB
testcase_73 AC 625 ms
199,040 KB
testcase_74 AC 625 ms
199,040 KB
testcase_75 AC 622 ms
199,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
void fast_io() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
}

int main() {
    fast_io();
    int n, m;
    cin >> n >> m;
    vector<int> a(n), b(n);
    vector<long long> c(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i] >> c[i];
    }
    vector<vector<long long>> dp(n, vector<long long>(m + 1, 0));
    for (int i = 0; i < n; i++) {
        for (int j = a[i]; j <= m; j++) {
            dp[i][j] = dp[i][j - a[i] + b[i]] + c[i] * b[i];
        }
    }
    for (int p = 1; p <= m; p++) {
        long long ans = 0;
        for (int i = 0; i < n; i++) {
            ans = max(ans, dp[i][p]);
        }
        cout << ans << "\n";
    }
}
0