結果

問題 No.2009 Drunkers' Contest
ユーザー Akijin_007Akijin_007
提出日時 2022-07-15 22:40:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 722 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 146,748 KB
最終ジャッジ日時 2023-09-10 03:40:01
合計ジャッジ時間 20,463 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,732 KB
testcase_01 AC 73 ms
71,836 KB
testcase_02 AC 73 ms
71,980 KB
testcase_03 AC 72 ms
71,532 KB
testcase_04 AC 71 ms
71,728 KB
testcase_05 AC 75 ms
71,788 KB
testcase_06 AC 74 ms
71,584 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 74 ms
71,892 KB
testcase_11 AC 74 ms
71,788 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
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 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 238 ms
138,048 KB
testcase_45 AC 278 ms
138,568 KB
testcase_46 AC 267 ms
146,748 KB
testcase_47 AC 252 ms
137,204 KB
testcase_48 AC 257 ms
137,020 KB
testcase_49 AC 275 ms
136,996 KB
testcase_50 AC 269 ms
137,748 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = 0
x = 0


def time(x, a, b):
    return a / (1 + x) + b * (1 + x)

ans = 0

c = []
a = 0
b = 0

for i in range(N):
    a += A[i]
    b += B[i]
    c.append([max(1, (a/b)**0.5)-1, i+1])

c = sorted(c, reverse=True)

k = 0
u = [0] * N
while c:
    t = c.pop()
    if t[1] > k:
        sa = 0
        sb = 0
        for i in range(k, t[1]):
            sa += A[i]
            sb += B[i]
        for i in range(k, t[1]):
            u[i] = max(0, (sa/sb) ** 0.5 - 1)
        k = t[1]

for i in range(N):
    ans += time(u[i], A[i], B[i])

print(ans)





0