結果
| 問題 | No.1015 おつりは要らないです |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-03 21:43:36 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 558 bytes |
| 記録 | |
| コンパイル時間 | 331 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 30,592 KB |
| 最終ジャッジ日時 | 2026-03-24 09:06:29 |
| 合計ジャッジ時間 | 19,831 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 7 RE * 23 TLE * 3 |
ソースコード
n, x,y,z = [int(x) for x in input().split()]
coins = [[ x,1000 ], [ y,5000 ], [ z,10000 ]]
ax = [int(x) for x in input().split()]
def solve():
global x,y,z
global coins
idx=0
while(idx<len(ax) and ax[idx] <= 0): idx+=1
if idx == len(ax): return True
for i in range(len(coins)):
cnt,val = coins[i]
if cnt <= 0:
continue
coins[i][0]-=1
ax[idx]-=val
if solve():
return True
ax[idx]+=val
coins[i][0]+=1
return False
print("Yes" if solve() else "No")