結果

問題 No.475 最終日 - Writerの怠慢
ユーザー fiordfiord
提出日時 2017-07-21 09:17:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 665 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 88,312 KB
最終ジャッジ日時 2024-04-17 09:57:27
合計ジャッジ時間 2,192 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,480 KB
testcase_01 AC 49 ms
61,056 KB
testcase_02 AC 50 ms
61,824 KB
testcase_03 AC 55 ms
64,640 KB
testcase_04 AC 121 ms
87,680 KB
testcase_05 AC 123 ms
87,936 KB
testcase_06 AC 117 ms
88,064 KB
testcase_07 AC 116 ms
88,064 KB
testcase_08 AC 114 ms
88,312 KB
testcase_09 AC 117 ms
87,808 KB
testcase_10 AC 119 ms
88,192 KB
testcase_11 AC 113 ms
87,936 KB
testcase_12 AC 84 ms
83,584 KB
testcase_13 AC 101 ms
86,784 KB
testcase_14 AC 35 ms
52,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
eps = 10**-9
n, s, ID = map(int, input().split())
a = list(map(int, input().split()))
p = a[ID] + 100 * s
a.pop(ID)
a.sort()
ret = 1.0
for i in reversed(range(len(a))):
    # a[i]+50s+|50s/(0.8+0.2r)|<p
    l = 1
    r = n - 1
    if a[i] + 50 * s + math.floor(50 * s / (0.80 + 0.20 * (n - 1))) + eps > p:
        l = r = n
    if a[i] + 100 * s <= p + eps:
        r = 1
    for t in range(20):
        mid = int((l + r) / 2.0)
        if a[i] + 50 * s + math.floor(50 * s / (0.80 + 0.20 * mid)) <= p + eps:
            r = mid
        else:
            l = mid
    # r位以下ならOK->(i+2-r)/(i+1)
    ret *= max(i + 2 - r, 0) / (i + 1)
print(ret)
0