結果
問題 | No.2681 ゲームセンターの両替 |
ユーザー | hato336 |
提出日時 | 2024-03-20 21:42:59 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 666 bytes |
コンパイル時間 | 143 ms |
コンパイル使用メモリ | 81,700 KB |
実行使用メモリ | 85,048 KB |
最終ジャッジ日時 | 2024-03-20 21:43:04 |
合計ジャッジ時間 | 4,533 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 131 ms
85,048 KB |
testcase_01 | AC | 130 ms
85,048 KB |
testcase_02 | AC | 133 ms
85,048 KB |
testcase_03 | AC | 129 ms
85,048 KB |
testcase_04 | WA | - |
testcase_05 | AC | 129 ms
85,048 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 129 ms
85,048 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 130 ms
85,048 KB |
testcase_14 | AC | 131 ms
85,048 KB |
testcase_15 | AC | 132 ms
85,048 KB |
testcase_16 | AC | 132 ms
85,048 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 130 ms
85,048 KB |
testcase_21 | AC | 131 ms
85,048 KB |
testcase_22 | AC | 132 ms
85,048 KB |
testcase_23 | AC | 131 ms
85,048 KB |
testcase_24 | AC | 131 ms
85,048 KB |
ソースコード
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) 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)