結果

問題 No.2009 Drunkers' Contest
ユーザー convexineqconvexineq
提出日時 2024-03-18 17:23:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 553 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 157,848 KB
最終ジャッジ日時 2024-03-18 17:23:49
合計ジャッジ時間 11,805 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,716 KB
testcase_01 AC 34 ms
53,716 KB
testcase_02 AC 35 ms
53,716 KB
testcase_03 AC 35 ms
53,588 KB
testcase_04 AC 35 ms
53,588 KB
testcase_05 AC 35 ms
53,716 KB
testcase_06 AC 34 ms
53,716 KB
testcase_07 AC 35 ms
53,716 KB
testcase_08 AC 34 ms
53,716 KB
testcase_09 AC 34 ms
53,716 KB
testcase_10 WA -
testcase_11 AC 36 ms
53,716 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 51 ms
64,684 KB
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 155 ms
140,872 KB
testcase_45 AC 157 ms
141,128 KB
testcase_46 AC 164 ms
155,340 KB
testcase_47 AC 150 ms
128,560 KB
testcase_48 AC 147 ms
128,560 KB
testcase_49 AC 148 ms
128,688 KB
testcase_50 WA -
testcase_51 AC 174 ms
128,560 KB
testcase_52 AC 196 ms
128,688 KB
testcase_53 AC 340 ms
155,832 KB
testcase_54 AC 163 ms
157,288 KB
testcase_55 AC 277 ms
157,848 KB
testcase_56 AC 160 ms
157,692 KB
testcase_57 AC 166 ms
157,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline
n = int(readline())
*A, = map(int,readline().split())
*B, = map(int,readline().split())

q = []
ans = 0.0
for a,b in zip(A,B):
    while a <= b:
        if not q:
            break
        else:
            x,y = q.pop()
            a += x
            b += y
    if a <= b:
        ans += a+b
    else:
        q.append((a,b))

x = y = 0.0
for a,b in q:
    if x*b >= a*y:
        x += a
        y += b
    else:
        ans += 2*((x*y)**0.5)
        x = a
        y = b
ans += 2*((x*y)**0.5)
print(ans)        
0