結果

問題 No.475 最終日 - Writerの怠慢
ユーザー shotoyooshotoyoo
提出日時 2021-07-02 01:14:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 726 bytes
コンパイル時間 1,728 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 90,536 KB
最終ジャッジ日時 2023-09-10 22:56:16
合計ジャッジ時間 3,869 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,344 KB
testcase_01 AC 73 ms
71,432 KB
testcase_02 AC 109 ms
75,472 KB
testcase_03 AC 110 ms
76,988 KB
testcase_04 AC 130 ms
90,448 KB
testcase_05 AC 131 ms
90,136 KB
testcase_06 AC 131 ms
90,384 KB
testcase_07 AC 139 ms
90,364 KB
testcase_08 AC 142 ms
90,536 KB
testcase_09 AC 135 ms
90,440 KB
testcase_10 AC 140 ms
90,292 KB
testcase_11 AC 135 ms
90,196 KB
testcase_12 AC 113 ms
89,244 KB
testcase_13 AC 99 ms
88,372 KB
testcase_14 AC 72 ms
71,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

sys.setrecursionlimit(2*10**5+10)
write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")
writef = lambda x: print("{:.12f}".format(x))


n,s,wid = list(map(int, input().split()))
a = list(map(int, input().split()))
w = a[wid] + 100*s
a.pop(wid)
a.sort(reverse=1)
vals = [int(50*s + (50*s / (0.8 + 0.2*i))) for i in range(1, n)[::-1]]
from bisect import bisect_right as br
ans = 1
j = 0
l = list(range(1,n))
for i in range(n-1):
    v = br(vals, w - a[i])
    if v<=i:
        ans = 0
        break
    ans *= (v-i)
    while j<len(l) and ans>l[j]:
        ans /= l[j]
        j += 1
for k in range(j, len(l)):
    ans /= l[k]
print(ans)
0