結果

問題 No.475 最終日 - Writerの怠慢
ユーザー mkawa2mkawa2
提出日時 2020-05-11 18:32:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 611 ms / 2,000 ms
コード長 1,507 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 11,160 KB
実行使用メモリ 38,540 KB
最終ジャッジ日時 2023-09-25 21:38:31
合計ジャッジ時間 8,041 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
29,680 KB
testcase_01 AC 129 ms
29,684 KB
testcase_02 AC 131 ms
29,800 KB
testcase_03 AC 168 ms
30,556 KB
testcase_04 AC 607 ms
37,828 KB
testcase_05 AC 596 ms
37,972 KB
testcase_06 AC 600 ms
37,960 KB
testcase_07 AC 599 ms
37,832 KB
testcase_08 AC 602 ms
38,136 KB
testcase_09 AC 611 ms
37,828 KB
testcase_10 AC 605 ms
38,032 KB
testcase_11 AC 601 ms
37,920 KB
testcase_12 AC 575 ms
38,540 KB
testcase_13 AC 599 ms
34,900 KB
testcase_14 AC 129 ms
29,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
from itertools import *
from bisect import *
from collections import *
from heapq import *
import sys

sys.setrecursionlimit(10 ** 6)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

# a+floor(50s+50s/(0.8+0.2r))<=w
# floor(50s+50s/(0.8+0.2r))<=w-a
# 50s+50s/(0.8+0.2r)<w-a+1
# 50s/(0.8+0.2r)<w-a+1-50s
# 250s/(4+r)<w-a+1-50s
# 1/(4+r)<(w-a+1-50s)/250s
# r>(450s-4w+4a-4)/(w-a+1-50s)

def main():
    n,s,wi=MI()
    aa=LI()
    w=aa[wi]+100*s
    #print(w)
    del aa[wi]
    ans=1
    n-=1
    for i,a in enumerate(sorted(aa,reverse=True)):
        def score(r):
            return 50*s+250*s//(4+r)

        def rank(a):
            l=0
            r=n+1
            while l+1<r:
                m=(l+r)//2
                if a+score(m)>w:l=m
                else:r=m
            return r

        r=rank(a)
        # r=(450*s-4*w+4*a-4)//(w-a+1-50*s)
        ans*=max(0,n-r+1-i)/(n-i)
        #print(a, r,max(0,n-r-i),n-i, max(0,n-r-i)/(n-i),ans)
    print(ans)

main()
0