結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
72,220 KB
testcase_01 AC 88 ms
72,344 KB
testcase_02 AC 87 ms
72,268 KB
testcase_03 AC 89 ms
72,272 KB
testcase_04 AC 91 ms
72,180 KB
testcase_05 AC 94 ms
72,160 KB
testcase_06 AC 86 ms
72,036 KB
testcase_07 AC 87 ms
72,184 KB
testcase_08 AC 87 ms
72,176 KB
testcase_09 AC 87 ms
72,188 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 264 ms
91,864 KB
testcase_16 AC 289 ms
91,996 KB
testcase_17 AC 271 ms
92,200 KB
testcase_18 AC 262 ms
91,892 KB
testcase_19 AC 264 ms
91,532 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 91 ms
71,952 KB
testcase_31 AC 147 ms
93,868 KB
testcase_32 AC 145 ms
93,404 KB
testcase_33 AC 147 ms
91,964 KB
testcase_34 AC 87 ms
72,004 KB
testcase_35 AC 86 ms
72,568 KB
testcase_36 AC 85 ms
72,168 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:
                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