結果

問題 No.2009 Drunkers' Contest
ユーザー convexineqconvexineq
提出日時 2024-03-19 03:05:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 570 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 157,728 KB
最終ジャッジ日時 2024-03-19 03:05:27
合計ジャッジ時間 10,077 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 34 ms
53,716 KB
testcase_02 AC 34 ms
53,716 KB
testcase_03 WA -
testcase_04 WA -
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 WA -
testcase_09 WA -
testcase_10 AC 35 ms
53,716 KB
testcase_11 AC 35 ms
53,716 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 AC 174 ms
141,948 KB
testcase_35 AC 178 ms
141,692 KB
testcase_36 AC 194 ms
142,464 KB
testcase_37 AC 176 ms
141,824 KB
testcase_38 AC 204 ms
141,824 KB
testcase_39 AC 191 ms
142,464 KB
testcase_40 AC 194 ms
142,592 KB
testcase_41 AC 195 ms
142,592 KB
testcase_42 AC 193 ms
145,664 KB
testcase_43 AC 185 ms
146,304 KB
testcase_44 WA -
testcase_45 AC 154 ms
141,120 KB
testcase_46 AC 165 ms
155,204 KB
testcase_47 AC 162 ms
134,956 KB
testcase_48 AC 169 ms
134,956 KB
testcase_49 AC 275 ms
128,940 KB
testcase_50 AC 165 ms
129,832 KB
testcase_51 AC 165 ms
135,084 KB
testcase_52 AC 159 ms
130,728 KB
testcase_53 AC 172 ms
155,440 KB
testcase_54 AC 168 ms
155,628 KB
testcase_55 AC 168 ms
157,728 KB
testcase_56 AC 166 ms
157,708 KB
testcase_57 AC 174 ms
157,568 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 q and a <= b:
        x,y = q.pop()
        a += x
        b += y
    if a <= b:
        ans += a+b
    else:
        q.append((a,b))

qq = []
for a,b in q:
    while qq:
        x,y = qq[-1]
        if b*x >= a*y:
            qq.pop()
            a += x
            b += y
        else:
            break
    qq.append((a,b))

ans = 0.0
for x,y in qq:
    ans += 2*(1.0*x*y)**0.5

print(ans)
0