結果
| 問題 |
No.1015 おつりは要らないです
|
| コンテスト | |
| ユーザー |
nagitaosu
|
| 提出日時 | 2020-04-03 22:06:43 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,169 bytes |
| コンパイル時間 | 91 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 21,912 KB |
| 最終ジャッジ日時 | 2024-07-03 03:03:37 |
| 合計ジャッジ時間 | 4,442 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 11 WA * 5 RE * 17 |
ソースコード
#!/usr/bin/env python3
import sys
input = sys.stdin.readline
n, x, y, z = map(int, input().split())
a = [int(item) for item in input().split()]
over_five = []
under_five = []
pay_first = 0
for item in a:
pay_first += (item // 10000) * 10000
if item % 10000 >= 5000:
over_five.append(item % 10000)
elif item % 10000 > 0:
under_five.append(item % 10000)
else:
under_five.append(1)
payment = min(z*10000, pay_first)
z -= payment // 10000; pay_first -= payment
payment = min(y*5000, pay_first)
y -= payment // 50000; pay_first -= payment
payment = min(y*1000, pay_first)
x -= payment // 1000; pay_first -= payment
if pay_first > 0:
print("No")
exit()
over_five.sort(reverse=True)
for i, item in over_five:
if z > 0:
z -= 1
continue
if y > 0:
y -= 1
under_five.append(item - 5000)
under_five.append(item)
under_five.sort(reverse=True)
for item in under_five:
if z > 0:
z -= 1
continue
if y > 0:
y -= 1
continue
use = (item + 999) // 1000
if x >= use:
x -= use
else:
print("No")
exit()
print("Yes")
nagitaosu