結果

問題 No.2389 Cheating Code Golf
ユーザー 👑 獅子座じゃない人獅子座じゃない人
提出日時 2023-06-18 17:48:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 198 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 86,908 KB
実行使用メモリ 79,664 KB
最終ジャッジ日時 2023-09-08 14:25:15
合計ジャッジ時間 7,711 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,616 KB
testcase_01 AC 75 ms
71,504 KB
testcase_02 AC 133 ms
77,964 KB
testcase_03 AC 196 ms
79,664 KB
testcase_04 AC 198 ms
79,336 KB
testcase_05 AC 100 ms
77,212 KB
testcase_06 AC 71 ms
71,388 KB
testcase_07 AC 102 ms
77,616 KB
testcase_08 AC 138 ms
78,428 KB
testcase_09 AC 73 ms
71,532 KB
testcase_10 AC 85 ms
76,900 KB
testcase_11 AC 102 ms
77,556 KB
testcase_12 AC 73 ms
71,332 KB
testcase_13 AC 125 ms
77,776 KB
testcase_14 AC 114 ms
77,736 KB
testcase_15 AC 86 ms
76,600 KB
testcase_16 AC 132 ms
78,060 KB
testcase_17 AC 74 ms
71,516 KB
testcase_18 AC 120 ms
77,640 KB
testcase_19 AC 75 ms
71,664 KB
testcase_20 AC 86 ms
76,852 KB
testcase_21 AC 109 ms
77,236 KB
testcase_22 AC 92 ms
76,628 KB
testcase_23 AC 75 ms
71,572 KB
testcase_24 AC 109 ms
77,784 KB
testcase_25 AC 106 ms
77,376 KB
testcase_26 AC 95 ms
76,832 KB
testcase_27 AC 121 ms
78,024 KB
testcase_28 AC 114 ms
77,648 KB
testcase_29 AC 92 ms
76,940 KB
testcase_30 AC 120 ms
77,780 KB
testcase_31 AC 97 ms
76,888 KB
testcase_32 AC 71 ms
71,388 KB
testcase_33 AC 76 ms
71,324 KB
testcase_34 AC 122 ms
78,208 KB
testcase_35 AC 99 ms
77,436 KB
testcase_36 AC 119 ms
77,960 KB
testcase_37 AC 92 ms
76,968 KB
testcase_38 AC 147 ms
78,436 KB
testcase_39 AC 75 ms
71,340 KB
testcase_40 AC 82 ms
76,844 KB
testcase_41 AC 84 ms
76,688 KB
testcase_42 AC 105 ms
77,540 KB
testcase_43 AC 72 ms
71,136 KB
testcase_44 AC 84 ms
76,840 KB
testcase_45 AC 142 ms
78,724 KB
testcase_46 AC 129 ms
78,316 KB
testcase_47 AC 71 ms
71,584 KB
testcase_48 AC 100 ms
76,808 KB
testcase_49 AC 113 ms
77,744 KB
testcase_50 AC 71 ms
71,568 KB
testcase_51 AC 101 ms
77,412 KB
testcase_52 AC 100 ms
77,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split()) 
abp=[map(int,input().split()) for _ in range(n)]
a,b,p=[list(i) for i in zip(*abp)]

dp=[[0 for j in range(m+1)] for i in range(2**n)]
for i in range(2**n):
    for j in range(m+1):
        for k in range(n):
            if (i>>k)%2:
                dp[i][j]=max(dp[i-2**k][j]+1/a[k],dp[i][j])
            if j:
                if (i>>k)%2:
                    dp[i][j]=max((dp[i-2**k][j]+1/b[k])/p[k]+dp[i][j-1]*(1-1/p[k]),dp[i][j])
print(dp[2**n-1][m])
0