結果

問題 No.1015 おつりは要らないです
ユーザー とろちゃとろちゃ
提出日時 2023-10-08 20:11:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 282 ms / 2,000 ms
コード長 1,419 bytes
コンパイル時間 408 ms
コンパイル使用メモリ 87,372 KB
実行使用メモリ 93,668 KB
最終ジャッジ日時 2023-10-08 20:11:15
合計ジャッジ時間 8,951 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
72,276 KB
testcase_01 AC 91 ms
72,296 KB
testcase_02 AC 85 ms
72,676 KB
testcase_03 AC 86 ms
72,460 KB
testcase_04 AC 89 ms
72,424 KB
testcase_05 AC 86 ms
72,184 KB
testcase_06 AC 87 ms
72,244 KB
testcase_07 AC 88 ms
72,624 KB
testcase_08 AC 85 ms
72,228 KB
testcase_09 AC 87 ms
72,572 KB
testcase_10 AC 267 ms
91,732 KB
testcase_11 AC 282 ms
92,372 KB
testcase_12 AC 259 ms
91,996 KB
testcase_13 AC 266 ms
92,012 KB
testcase_14 AC 273 ms
92,384 KB
testcase_15 AC 264 ms
91,896 KB
testcase_16 AC 278 ms
91,756 KB
testcase_17 AC 271 ms
92,252 KB
testcase_18 AC 263 ms
91,916 KB
testcase_19 AC 263 ms
91,708 KB
testcase_20 AC 253 ms
91,756 KB
testcase_21 AC 244 ms
91,920 KB
testcase_22 AC 243 ms
91,592 KB
testcase_23 AC 249 ms
91,544 KB
testcase_24 AC 253 ms
91,816 KB
testcase_25 AC 250 ms
91,708 KB
testcase_26 AC 243 ms
91,708 KB
testcase_27 AC 244 ms
91,784 KB
testcase_28 AC 249 ms
91,680 KB
testcase_29 AC 260 ms
91,868 KB
testcase_30 AC 90 ms
71,996 KB
testcase_31 AC 139 ms
93,668 KB
testcase_32 AC 140 ms
93,664 KB
testcase_33 AC 140 ms
92,176 KB
testcase_34 AC 86 ms
72,424 KB
testcase_35 AC 85 ms
72,240 KB
testcase_36 AC 86 ms
72,000 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:
                if -pop + p * num:
                    heappush(A, -pop + p * num)
                num = 0
            else:
                if m:
                    heappush(A, -m)
                num -= d
        else:
            num -= 1


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