結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,372 KB
testcase_01 AC 71 ms
71,452 KB
testcase_02 AC 81 ms
76,112 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 184 ms
92,264 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 /= i+1

print(ans)
0