結果

問題 No.31 悪のミックスジュース
ユーザー yaoshimaxyaoshimax
提出日時 2015-02-15 14:16:54
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 6,744 KB
実行使用メモリ 6,156 KB
最終ジャッジ日時 2023-09-06 01:15:10
合計ジャッジ時間 1,544 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 11 ms
5,872 KB
testcase_05 AC 12 ms
5,876 KB
testcase_06 AC 11 ms
5,988 KB
testcase_07 AC 11 ms
5,864 KB
testcase_08 AC 11 ms
5,952 KB
testcase_09 WA -
testcase_10 AC 11 ms
5,864 KB
testcase_11 WA -
testcase_12 AC 11 ms
6,012 KB
testcase_13 AC 11 ms
6,008 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,V=map(int,raw_input().split())
C=map(int,raw_input().split())
s=0
S=[]
A=[]
for i in range(N):
    s+=C[i]
    S.append(s)
    A.append((s/(1.0+i),i))
A.sort()

i=0
v=N
p=s
while v < V:
    while A[i][1]+1 > V-v:
        i+=1
    t = (V-v)/(A[i][1]+1)
    v+= t*(A[i][1]+1)
    p+= t*S[A[i][1]]
print p


0