結果

問題 No.2389 Cheating Code Golf
ユーザー wtz2333wtz2333
提出日時 2023-07-21 23:17:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,004 bytes
コンパイル時間 1,619 ms
コンパイル使用メモリ 170,352 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 23:17:34
合計ジャッジ時間 3,405 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,348 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 2 ms
4,348 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 2 ms
4,348 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 2 ms
4,348 KB
testcase_33 AC 2 ms
4,348 KB
testcase_34 AC 3 ms
4,348 KB
testcase_35 AC 2 ms
4,348 KB
testcase_36 AC 2 ms
4,348 KB
testcase_37 AC 2 ms
4,348 KB
testcase_38 AC 3 ms
4,348 KB
testcase_39 AC 2 ms
4,348 KB
testcase_40 AC 2 ms
4,348 KB
testcase_41 AC 2 ms
4,348 KB
testcase_42 AC 2 ms
4,348 KB
testcase_43 AC 2 ms
4,348 KB
testcase_44 AC 2 ms
4,348 KB
testcase_45 AC 2 ms
4,348 KB
testcase_46 AC 2 ms
4,348 KB
testcase_47 AC 2 ms
4,348 KB
testcase_48 AC 2 ms
4,348 KB
testcase_49 AC 2 ms
4,348 KB
testcase_50 AC 2 ms
4,348 KB
testcase_51 AC 2 ms
4,348 KB
testcase_52 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
double dp[101][101][101];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    vector<int> a(n + 1),b(n + 1),p(n + 1);
    for(int i = 1;i <= n;i ++){
        cin >> a[i] >> b[i] >> p[i];
    }
    for(int i = 1;i <= n;i ++){
        for(int j = 0;j <= i;j ++){
            for(int k = 0;k <= m;k ++){
                if(j > 0)dp[i][j][k] = max(dp[i][j][k],dp[i - 1][j - 1][k] + (1.0 / a[i]));
                double tmp = 1;
                for(int kk = 1;kk <= k;kk ++){

                    dp[i][j][k] = max(dp[i][j][k],dp[i - 1][j][k - kk] + tmp * (1.0 / p[i]) * (1.0 / b[i]));
                    tmp *= (1.0 - 1.0 / p[i]);
                }
            }
        }
    } 
    double ans = 0;
    for(int j = 0;j <= n;j ++){
        for(int k = 0;k <= m;k ++){
            ans = max(ans,dp[n][j][k]);
        }
    }
    cout << fixed << setprecision(10) << ans << "\n";
    return 0;
}
0