結果
問題 |
No.2009 Drunkers' Contest
|
ユーザー |
![]() |
提出日時 | 2022-07-15 22:04:44 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 394 bytes |
コンパイル時間 | 639 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 135,920 KB |
最終ジャッジ日時 | 2024-06-27 18:04:38 |
合計ジャッジ時間 | 8,910 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)