結果
| 問題 |
No.2009 Drunkers' Contest
|
| コンテスト | |
| ユーザー |
tktk_snsn
|
| 提出日時 | 2022-07-15 22:15:14 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 402 bytes |
| コンパイル時間 | 518 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 43,312 KB |
| 最終ジャッジ日時 | 2024-06-27 18:32:53 |
| 合計ジャッジ時間 | 15,714 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 11 WA * 43 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
P = []
Q = []
for a, b in zip(A, B):
while P and P[-1] * Q[-1] >= a * b:
a += P.pop()
b += Q.pop()
P.append(a)
Q.append(b)
ans = 0
for p, q in zip(P, Q):
x = 0
if p > q:
x = (p / q) ** .5 - 1
ans += p / (1 + x)
ans += q * (1 + x)
print("{:.13f}".format(ans))
tktk_snsn