結果
問題 |
No.1015 おつりは要らないです
|
ユーザー |
|
提出日時 | 2020-04-30 19:04:26 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 838 bytes |
コンパイル時間 | 372 ms |
コンパイル使用メモリ | 82,168 KB |
実行使用メモリ | 88,500 KB |
最終ジャッジ日時 | 2024-12-16 09:37:04 |
合計ジャッジ時間 | 5,457 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 11 WA * 22 |
ソースコード
import sys sys.setrecursionlimit(10 ** 7) rl = sys.stdin.readline def solve(): N, X, Y, Z = map(int, rl().split()) A = list(map(int, rl().split())) i = 0 while 0 < Z and i < N: t = min(A[i] // 10000, Z) A[i] -= 10000 * t Z -= t i += 1 A.sort(reverse=True) i = 0 while 0 < Z and i < N: A[i] -= 10000 Z -= 1 i += 1 i = 0 while 0 < Y and i < N: t = min(A[i] // 5000, Y) A[i] -= 5000 * t Z -= t i += 1 A.sort(reverse=True) i = 0 while 0 < Y and i < N: A[i] -= 5000 Y -= 1 i += 1 cnt = 0 for ai in A: if ai < 0: continue cnt += -(-(ai + 1) // 1000) print('Yes' if cnt <= X else 'No') if __name__ == '__main__': solve()