結果

問題 No.1736 Princess vs. Dragoness
ユーザー 👑 tamatotamato
提出日時 2021-11-12 21:45:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 913 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,760 KB
実行使用メモリ 76,896 KB
最終ジャッジ日時 2023-08-17 00:41:53
合計ジャッジ時間 4,681 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,660 KB
testcase_01 AC 70 ms
71,780 KB
testcase_02 AC 69 ms
71,460 KB
testcase_03 AC 81 ms
76,428 KB
testcase_04 AC 86 ms
76,716 KB
testcase_05 AC 77 ms
76,152 KB
testcase_06 AC 83 ms
76,764 KB
testcase_07 AC 95 ms
76,896 KB
testcase_08 AC 86 ms
76,696 KB
testcase_09 AC 90 ms
76,704 KB
testcase_10 AC 73 ms
71,852 KB
testcase_11 AC 94 ms
76,708 KB
testcase_12 AC 86 ms
76,704 KB
testcase_13 AC 82 ms
76,592 KB
testcase_14 AC 92 ms
76,848 KB
testcase_15 AC 81 ms
76,732 KB
testcase_16 AC 79 ms
76,492 KB
testcase_17 AC 90 ms
76,756 KB
testcase_18 AC 82 ms
76,636 KB
testcase_19 AC 82 ms
76,676 KB
testcase_20 AC 78 ms
76,376 KB
testcase_21 AC 89 ms
76,896 KB
testcase_22 AC 87 ms
76,828 KB
testcase_23 AC 81 ms
76,832 KB
testcase_24 AC 78 ms
76,316 KB
testcase_25 AC 81 ms
76,268 KB
testcase_26 AC 83 ms
76,732 KB
testcase_27 AC 83 ms
76,588 KB
testcase_28 AC 82 ms
76,728 KB
testcase_29 AC 80 ms
76,748 KB
testcase_30 AC 82 ms
76,584 KB
testcase_31 AC 84 ms
76,740 KB
testcase_32 AC 79 ms
76,788 KB
testcase_33 AC 70 ms
71,812 KB
testcase_34 AC 70 ms
71,852 KB
testcase_35 AC 71 ms
71,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N, A, B, X, Y = map(int, input().split())
    H = list(map(int, input().split()))

    ok = sum(H)
    ng = -1
    mid = (ok + ng) // 2
    while ok - ng > 1:
        HH = [max(0, h - mid) for h in H]
        AA = A
        cnt = 0
        for h in HH:
            cnt += h // X
        if cnt >= AA:
            S = sum(HH) - AA * X
        else:
            HHH = [h % X for h in HH]
            AA -= cnt
            if AA >= N:
                S = 0
            else:
                HHH.sort(reverse=True)
                for i in range(AA):
                    HHH[i] = 0
                S = sum(HHH)
        if S <= B * Y:
            ok = mid
        else:
            ng = mid
        mid = (ok + ng) // 2

    if ok:
        print("No")
    else:
        print("Yes")


if __name__ == '__main__':
    main()
0