結果

問題 No.1151 チャレンジゲーム
ユーザー 37zigen37zigen
提出日時 2020-08-09 03:55:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 724 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 30,248 KB
最終ジャッジ日時 2024-04-14 07:45:35
合計ジャッジ時間 20,817 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
18,076 KB
testcase_01 AC 34 ms
10,752 KB
testcase_02 AC 38 ms
10,752 KB
testcase_03 AC 31 ms
10,880 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 32 ms
10,880 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 30 ms
10,880 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 31 ms
10,880 KB
testcase_10 AC 31 ms
11,008 KB
testcase_11 AC 34 ms
11,008 KB
testcase_12 AC 34 ms
10,752 KB
testcase_13 AC 1,046 ms
14,144 KB
testcase_14 AC 1,043 ms
14,052 KB
testcase_15 AC 1,047 ms
14,184 KB
testcase_16 AC 1,044 ms
14,128 KB
testcase_17 AC 1,057 ms
14,188 KB
testcase_18 AC 1,049 ms
14,100 KB
testcase_19 AC 1,039 ms
14,044 KB
testcase_20 AC 1,045 ms
14,024 KB
testcase_21 AC 1,044 ms
14,288 KB
testcase_22 AC 1,045 ms
14,112 KB
testcase_23 AC 1,059 ms
14,184 KB
testcase_24 AC 1,049 ms
14,168 KB
testcase_25 AC 1,065 ms
14,060 KB
testcase_26 AC 1,050 ms
14,176 KB
testcase_27 AC 1,044 ms
14,284 KB
testcase_28 TLE -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=[int(x) for x in input().split()]
s=[0]*(1<<N)
for i in range(1<<N):
    for j in range(N):
        if (i&(1<<j))>0:
            s[i]+=A[j]
dp={}
def f(a,b,t):
    if (a|b)==(1<<N)-1:
        return 1 if 2*s[a]+t>2*s[b] else 0
    c=int((a|(b<<N))*t)
    if c in dp:
        return dp[c]
    ret=0
    for i in range(N):
        na=a|(1<<i)
        if (na|b)==(a|b):
            continue
        e=1
        for j in range(N):
            nb=b|(1<<j)
            if (a|nb)==(a|b):
                continue
            p,q=A[i],A[j]
            v=1/p-f(b,na,t*(-1))/p+f(a,nb,t)/q*(1-1/p)
            v/=(p+q-1)/(p*q)
            e=min(e,v)
        ret=max(ret,e)
    dp[c]=ret
    return ret
print(f(0,0,-1))
0