結果
問題 | No.1015 おつりは要らないです |
ユーザー | buey_t |
提出日時 | 2023-03-21 19:14:58 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,019 bytes |
コンパイル時間 | 399 ms |
コンパイル使用メモリ | 82,216 KB |
実行使用メモリ | 106,832 KB |
最終ジャッジ日時 | 2024-09-18 14:28:21 |
合計ジャッジ時間 | 7,825 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 111 ms
85,240 KB |
testcase_01 | AC | 113 ms
84,872 KB |
testcase_02 | AC | 114 ms
85,292 KB |
testcase_03 | AC | 110 ms
85,128 KB |
testcase_04 | AC | 114 ms
85,128 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 117 ms
85,312 KB |
testcase_08 | AC | 110 ms
85,328 KB |
testcase_09 | AC | 111 ms
85,016 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 193 ms
106,660 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 200 ms
106,620 KB |
testcase_18 | AC | 192 ms
106,040 KB |
testcase_19 | AC | 194 ms
106,180 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 | 115 ms
85,272 KB |
testcase_31 | AC | 155 ms
102,168 KB |
testcase_32 | AC | 150 ms
102,316 KB |
testcase_33 | AC | 161 ms
104,584 KB |
testcase_34 | AC | 113 ms
85,256 KB |
testcase_35 | AC | 113 ms
84,976 KB |
testcase_36 | AC | 116 ms
85,304 KB |
ソースコード
def main(): from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum from heapq import heapify, heappop, heappush from bisect import bisect_left, bisect_right from copy import deepcopy import copy import random from collections import deque,Counter,defaultdict from itertools import permutations,combinations from decimal import Decimal,ROUND_HALF_UP #tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP) from functools import lru_cache, reduce #@lru_cache(maxsize=None) from operator import add,sub,mul,xor,and_,or_,itemgetter INF = 10**18 mod1 = 10**9+7 mod2 = 998244353 #DecimalならPython ''' ''' N,X,Y,Z = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) for i in range(N): if A[i] > 10000 and X > 0: cnt = A[i]//10000 A[i] -= min(cnt, X)*10000 X -= min(cnt,X) A.sort(reverse=True) for i in range(N): if X > 0 and A[i] <= 10000: A[i] = 0 X -= 1 for i in range(N): if A[i] > 5000 and Y > 0: cnt = A[i]//5000 A[i] -= min(cnt, Y)*5000 Y -= min(cnt,Y) A.sort(reverse=True) for i in range(N): if Y > 0 and A[i] <= 5000: A[i] = 0 Y -= 1 for i in range(N): if A[i] > 1000 and Z > 0: cnt = A[i]//1000 A[i] -= min(cnt, Z)*1000 Z -= min(cnt,Z) A.sort(reverse=True) for i in range(N): if Z > 0 and A[i] <= 1000: A[i] = 0 Z -= 1 for i in range(N): if A[i] != 0: print('No') exit() print('Yes') if __name__ == '__main__': main()