結果

問題 No.475 最終日 - Writerの怠慢
ユーザー maspymaspy
提出日時 2020-03-18 20:23:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 635 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,904 KB
実行使用メモリ 15,536 KB
最終ジャッジ日時 2023-08-20 20:12:45
合計ジャッジ時間 2,445 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,880 KB
testcase_01 AC 12 ms
7,800 KB
testcase_02 AC 14 ms
7,836 KB
testcase_03 AC 23 ms
8,892 KB
testcase_04 AC 111 ms
15,416 KB
testcase_05 AC 110 ms
15,536 KB
testcase_06 AC 120 ms
15,460 KB
testcase_07 AC 119 ms
15,376 KB
testcase_08 AC 118 ms
15,524 KB
testcase_09 AC 127 ms
15,444 KB
testcase_10 AC 115 ms
15,384 KB
testcase_11 AC 112 ms
15,448 KB
testcase_12 AC 108 ms
15,444 KB
testcase_13 AC 29 ms
12,444 KB
testcase_14 AC 13 ms
7,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


N, S, writer, *A = map(int, read().split())

me = A[writer] + 100 * S
INF = N + 10
R = [0] * N
for i, x in enumerate(A):
    if i == writer:
        continue
    RHS = me + 1 - x - 50 * S
    if RHS <= 0:
        print(0)
        exit()
    R[i] = 250 * S // RHS - 3

R = [x for i, x in enumerate(R) if i != writer]
R.sort()
R.append(N+100)
cand = 0
i = 0
p = 1
for n in range(1, N):
    while R[i] <= n:
        i += 1
        cand += 1
    p *= cand
    p /= (N - n)
    cand -= 1

print(p)
0