結果

問題 No.1015 おつりは要らないです
ユーザー とろちゃとろちゃ
提出日時 2023-10-08 20:07:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,344 bytes
コンパイル時間 777 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 93,720 KB
最終ジャッジ日時 2023-10-08 20:07:11
合計ジャッジ時間 9,667 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
72,468 KB
testcase_01 AC 91 ms
72,256 KB
testcase_02 AC 91 ms
72,048 KB
testcase_03 AC 91 ms
72,052 KB
testcase_04 AC 90 ms
72,180 KB
testcase_05 AC 90 ms
72,512 KB
testcase_06 AC 90 ms
72,284 KB
testcase_07 AC 91 ms
72,248 KB
testcase_08 AC 92 ms
71,996 KB
testcase_09 AC 92 ms
72,512 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 275 ms
91,528 KB
testcase_16 AC 282 ms
91,912 KB
testcase_17 AC 283 ms
92,456 KB
testcase_18 AC 284 ms
91,960 KB
testcase_19 AC 275 ms
91,572 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 89 ms
72,168 KB
testcase_31 AC 149 ms
93,524 KB
testcase_32 AC 149 ms
93,720 KB
testcase_33 AC 145 ms
92,416 KB
testcase_34 AC 91 ms
72,164 KB
testcase_35 WA -
testcase_36 AC 90 ms
72,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1")
# from bisect import *
# from collections import *
from heapq import *

# from itertools import *
# from sortedcontainers import *
# from math import lcm
# from datetime import *
# from decimal import *  # PyPyだと遅い
# from string import ascii_lowercase, ascii_uppercase
# import numpy as np
# from atcoder.dsu import *
# from atcoder.lazysegtree import *
# from atcoder.segtree import *
# from sortedcontainers import *
from random import *
import sys
import os

is_AtC = os.getenv("ATCODER", 0)
# sys.setrecursionlimit(10**6) # PyPyは呪文を付ける
INF = 1 << 61
MOD = 998244353
MOD = 10**9 + 7
File = sys.stdin


def input():
    return File.readline()


# ///////////////////////////////////////////////////////////////////////////


N, X, Y, Z = map(int, input().split())
A = list(map(lambda x: -int(x) - 1, input().split()))

heapify(A)


def operation(num, p):
    while A and num:
        pop = -heappop(A)
        d, m = divmod(pop, p)
        if d:
            if d >= num:
                heappush(A, -pop + p * num)
                num = 0
            else:
                heappush(A, -m)
                num -= d
        else:
            num -= 1


operation(Z, 10000)
operation(Y, 5000)
operation(X, 1000)
if not A:
    print("Yes")
else:
    print("No")
0