結果

問題 No.475 最終日 - Writerの怠慢
ユーザー roarisroaris
提出日時 2019-12-17 22:44:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 529 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 93,600 KB
最終ジャッジ日時 2023-09-18 02:16:21
合計ジャッジ時間 3,512 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,236 KB
testcase_01 AC 73 ms
71,400 KB
testcase_02 AC 80 ms
75,740 KB
testcase_03 AC 91 ms
76,812 KB
testcase_04 AC 180 ms
93,600 KB
testcase_05 AC 183 ms
93,456 KB
testcase_06 AC 189 ms
93,472 KB
testcase_07 AC 194 ms
93,400 KB
testcase_08 AC 201 ms
93,336 KB
testcase_09 AC 190 ms
93,320 KB
testcase_10 AC 196 ms
93,368 KB
testcase_11 AC 192 ms
93,208 KB
testcase_12 AC 173 ms
92,280 KB
testcase_13 AC 185 ms
91,964 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)
    ans /= N-1-i
    
print(ans)
0