結果

問題 No.66 輝け☆全国たこやき杯
ユーザー rkyiolklorkyiolklo
提出日時 2020-04-20 22:06:58
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 312 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 10,988 KB
実行使用メモリ 7,992 KB
最終ジャッジ日時 2023-07-28 16:41:52
合計ジャッジ時間 1,802 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 RE -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 79 ms
7,756 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

M=int(input())
s=[int(input())**2 for i in range(2**M)]
n=2**M
p=[1]*n 
for m in range(M-1):
    q=[0]*n 
    for i in range(n):
        b=((i>>m)^1)<<m 
        for j in range(b,b+(1<<m)):
            q[i]+=p[i]*s[i]*p[j]/(s[i]+s[j])
    p=q 
print(p[0]*s[0]*sum(p[j]/(s[i]+s[j]) for j in range(n//2,n)))     
0