結果

問題 No.2389 Cheating Code Golf
ユーザー 👑 獅子座じゃない人獅子座じゃない人
提出日時 2023-06-18 17:23:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 485 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 10,828 KB
実行使用メモリ 15,576 KB
最終ジャッジ日時 2023-09-08 14:24:55
合計ジャッジ時間 13,657 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,984 KB
testcase_01 AC 15 ms
7,848 KB
testcase_02 AC 483 ms
9,984 KB
testcase_03 TLE -
testcase_04 TLE -
testcase_05 AC 55 ms
8,344 KB
testcase_06 AC 17 ms
7,872 KB
testcase_07 AC 89 ms
8,568 KB
testcase_08 AC 655 ms
10,352 KB
testcase_09 AC 16 ms
7,868 KB
testcase_10 AC 18 ms
7,780 KB
testcase_11 AC 96 ms
8,612 KB
testcase_12 AC 16 ms
7,788 KB
testcase_13 AC 496 ms
9,916 KB
testcase_14 AC 152 ms
8,536 KB
testcase_15 AC 19 ms
7,956 KB
testcase_16 AC 546 ms
9,808 KB
testcase_17 AC 15 ms
7,812 KB
testcase_18 AC 107 ms
8,488 KB
testcase_19 AC 15 ms
7,796 KB
testcase_20 AC 18 ms
7,812 KB
testcase_21 AC 53 ms
8,300 KB
testcase_22 AC 19 ms
7,964 KB
testcase_23 AC 16 ms
7,788 KB
testcase_24 AC 83 ms
8,332 KB
testcase_25 AC 54 ms
8,308 KB
testcase_26 AC 21 ms
7,860 KB
testcase_27 AC 167 ms
8,860 KB
testcase_28 AC 76 ms
8,312 KB
testcase_29 AC 22 ms
7,784 KB
testcase_30 AC 400 ms
9,712 KB
testcase_31 AC 39 ms
8,400 KB
testcase_32 AC 17 ms
7,916 KB
testcase_33 AC 18 ms
7,864 KB
testcase_34 AC 220 ms
9,140 KB
testcase_35 AC 46 ms
8,264 KB
testcase_36 AC 397 ms
9,632 KB
testcase_37 AC 23 ms
7,768 KB
testcase_38 AC 949 ms
11,256 KB
testcase_39 AC 17 ms
7,788 KB
testcase_40 AC 18 ms
7,860 KB
testcase_41 AC 22 ms
8,396 KB
testcase_42 AC 26 ms
8,012 KB
testcase_43 AC 16 ms
7,792 KB
testcase_44 AC 18 ms
7,872 KB
testcase_45 AC 825 ms
10,936 KB
testcase_46 AC 380 ms
9,648 KB
testcase_47 AC 16 ms
7,732 KB
testcase_48 AC 79 ms
8,360 KB
testcase_49 AC 152 ms
8,616 KB
testcase_50 AC 15 ms
7,916 KB
testcase_51 AC 99 ms
8,612 KB
testcase_52 AC 52 ms
8,244 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