結果
| 問題 |
No.1015 おつりは要らないです
|
| コンテスト | |
| ユーザー |
mkawa2
|
| 提出日時 | 2020-04-03 22:49:30 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,004 bytes |
| コンパイル時間 | 183 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 21,816 KB |
| 最終ジャッジ日時 | 2024-07-03 05:15:38 |
| 合計ジャッジ時間 | 4,327 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 15 WA * 18 |
ソースコード
from heapq import *
from collections import deque
import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]
def main():
n,x,y,z=MI()
aa=LI()
for i in range(n):
c=aa[i]//10000
c=min(c,x)
aa[i]-=10000*c
x-=c
if x==0:break
aa.sort(reverse=True)
while aa and aa[-1]==0:aa.pop()
aa=aa[x:]
for i in range(len(aa)):
c=aa[i]//5000
c=min(c,y)
aa[i]-=5000*c
y-=c
if y==0:break
aa.sort(reverse=True)
while aa and aa[-1]==0:aa.pop()
aa=aa[y:]
for a in aa:
c=a//1000+1
z-=c
if z<0:
print("No")
exit()
print("Yes")
main()
mkawa2