結果

問題 No.2681 ゲームセンターの両替
ユーザー tassei903tassei903
提出日時 2024-03-20 21:46:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 721 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,216 KB
実行使用メモリ 53,980 KB
最終ジャッジ日時 2024-04-15 10:13:05
合計ジャッジ時間 2,392 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
53,008 KB
testcase_01 AC 47 ms
53,980 KB
testcase_02 AC 46 ms
52,496 KB
testcase_03 AC 47 ms
53,088 KB
testcase_04 AC 46 ms
52,028 KB
testcase_05 AC 47 ms
52,000 KB
testcase_06 AC 46 ms
53,304 KB
testcase_07 AC 46 ms
52,700 KB
testcase_08 AC 44 ms
53,340 KB
testcase_09 AC 45 ms
53,336 KB
testcase_10 AC 46 ms
53,532 KB
testcase_11 AC 46 ms
52,556 KB
testcase_12 AC 47 ms
53,168 KB
testcase_13 AC 44 ms
52,472 KB
testcase_14 AC 48 ms
52,796 KB
testcase_15 AC 45 ms
52,872 KB
testcase_16 AC 44 ms
52,892 KB
testcase_17 AC 47 ms
52,524 KB
testcase_18 AC 48 ms
52,212 KB
testcase_19 AC 45 ms
52,340 KB
testcase_20 AC 47 ms
53,088 KB
testcase_21 AC 47 ms
52,864 KB
testcase_22 AC 47 ms
52,276 KB
testcase_23 AC 47 ms
52,772 KB
testcase_24 AC 48 ms
53,572 KB
testcase_25 AC 44 ms
52,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
coin = [1, 5, 10, 50, 100, 500, 1000, 5000, 10000]
def convert_japanese_yen(yen):
    count = [0] * 9
    for i in range(8, -1, -1):
        count[i] = yen // coin[i]
        yen %= coin[i]
    return count


c, y = na()

a = convert_japanese_yen(y)

if y//100 < c:
    print("can't exchange")
elif a[4] >= c:
    print("no exchange")
else:
    print((a[4] - c)%5 + c)
0