結果

問題 No.32 貯金箱の憂鬱
ユーザー nckkhtnckkht
提出日時 2017-01-14 14:47:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 795 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,944 KB
実行使用メモリ 7,948 KB
最終ジャッジ日時 2023-08-23 10:34:44
合計ジャッジ時間 1,222 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 16 ms
7,916 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

K = 0 #1000円札の枚数
L = int(input()) #100円硬貨の枚数
M = int(input()) #25円硬貨の枚数
N = int(input()) #1円硬貨の枚数

#x 両替対象の硬貨
#y 両替後対象の硬貨/紙幣
#z1 両替前の硬貨の金額
#z2 両替後の硬貨/紙幣の金額
def Exchange(x,y,z1,z2):
    if (x * z1) % z2 == 0:
        return 0, int(y + x // (z2 / z1))
    else:
        return int(x % (z2 / z1)), int(y + x // (z2 / z1))

if N < 25:
    if M >= 4:
        M, L = Exchange(M, L, 25, 100)
        if 10 <= L <= 1000:
            L, K = Exchange(L, K, 100, 1000)
elif 25 <= N <= 1000:
    N, M = Exchange(N, M, 1, 25)
    if M >= 4:
        M, L = Exchange(M, L, 25, 100)
        if 10 <= L <= 1000:
            L, K = Exchange(L, K, 100, 1000)
else:
    pass
print(K + L + M + N)
0