結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
72,492 KB
testcase_01 AC 98 ms
72,360 KB
testcase_02 AC 98 ms
72,148 KB
testcase_03 AC 101 ms
72,224 KB
testcase_04 AC 102 ms
72,032 KB
testcase_05 AC 99 ms
72,360 KB
testcase_06 AC 86 ms
72,224 KB
testcase_07 AC 86 ms
72,324 KB
testcase_08 AC 86 ms
72,336 KB
testcase_09 AC 100 ms
72,252 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 262 ms
91,692 KB
testcase_16 AC 264 ms
92,080 KB
testcase_17 AC 272 ms
92,160 KB
testcase_18 AC 265 ms
91,892 KB
testcase_19 AC 289 ms
92,076 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 87 ms
72,040 KB
testcase_31 AC 160 ms
93,688 KB
testcase_32 AC 145 ms
93,688 KB
testcase_33 AC 136 ms
91,912 KB
testcase_34 AC 86 ms
72,336 KB
testcase_35 WA -
testcase_36 AC 86 ms
72,120 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