結果

問題 No.1015 おつりは要らないです
ユーザー とろちゃ
提出日時 2023-10-08 19:57:59
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,193 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 98,636 KB
最終ジャッジ日時 2024-07-26 18:11:26
合計ジャッジ時間 4,481 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6 TLE * 1 -- * 26
権限があれば一括ダウンロードができます

ソースコード

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()[:-1]


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


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

heapify(A)


def operation(lis, num, p):
    while lis and num:
        pop = -heappop(lis)
        if pop > p:
            heappush(lis, -pop + p)
        num -= 1


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