結果

問題 No.475 最終日 - Writerの怠慢
ユーザー roarisroaris
提出日時 2019-12-17 22:33:27
言語 PyPy3
(7.3.13)
結果
RE  
実行時間 -
コード長 544 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 86,956 KB
実行使用メモリ 260,740 KB
最終ジャッジ日時 2023-09-18 01:58:38
合計ジャッジ時間 8,746 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,456 KB
testcase_01 AC 73 ms
71,396 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 AC 185 ms
92,240 KB
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def binary_search(ai):
    left, right = 1, N-1
    
    while left<=right:
        mid = (left+right)//2
        
        if ai+50*S+50*S//(0.8+0.2*mid)<=W:
            right = mid-1
        else:
            left = mid+1
    
    return left

N, S, writer_id = map(int, input().split())
a = list(map(int, input().split()))
W = a[writer_id]+100*S
a = [a[i] for i in range(N) if i!=writer_id]
a.sort(reverse=True)
ans = 1

for i in range(N-1):
    j = binary_search(a[i])
    ans *= max(0, N-j-i)

for i in range(1, N):
    ans /= i

print(ans)
0