結果
| 問題 |
No.2681 ゲームセンターの両替
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-20 21:46:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 675 bytes |
| コンパイル時間 | 236 ms |
| コンパイル使用メモリ | 82,460 KB |
| 実行使用メモリ | 86,044 KB |
| 最終ジャッジ日時 | 2024-09-30 07:34:09 |
| 合計ジャッジ時間 | 4,135 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 11 WA * 12 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
input = sys.stdin.readline
c,y = map(int,input().split())
if y // 100 < c:
exit(print('can\'t exchange'))
d = collections.defaultdict(int)
z = [1,5,10,50,100,500,1000,2000,5000,10000]
for i in reversed(z):
d[i] = y // i
y %= i
if d[100] >= c:
exit(print('no exchange'))
print((c+5-1)//5)
exit()
ans = 0
now = d[100]
for i in reversed(z):
if i <= 100:
break
if now >= c:
break
while d[i] > 0 and now < c:
now += i // 100
d[i] -= 1
ans += 1
print(ans)