結果
| 問題 | No.2009 Drunkers' Contest |
| コンテスト | |
| ユーザー |
yuusanlondon
|
| 提出日時 | 2022-07-15 22:04:44 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 394 bytes |
| 記録 | |
| コンパイル時間 | 158 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 129,280 KB |
| 最終ジャッジ日時 | 2026-03-15 19:48:00 |
| 合計ジャッジ時間 | 5,955 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 WA * 40 |
ソースコード
import math
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=[0]*n
asum=0
bsum=0
for i in range(n-1,-1,-1):
asum+=a[i]
bsum+=b[i]
if asum>=bsum:
c[i]=min(math.sqrt(a[i]/b[i])-1,math.sqrt(asum/bsum)-1)
currmax=0
for i in range(n):
currmax=max(currmax,c[i])
c[i]=currmax
ans=0
for i in range(n):
ans+=a[i]/(1+c[i])
ans+=b[i]*(1+c[i])
print(ans)
yuusanlondon