結果

問題 No.825 賢いお買い物
ユーザー gojoTYgojoTY
提出日時 2019-05-26 02:26:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 11,820 KB
実行使用メモリ 10,016 KB
最終ジャッジ日時 2023-10-17 17:48:13
合計ジャッジ時間 1,688 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 30 ms
10,016 KB
testcase_02 AC 28 ms
10,016 KB
testcase_03 AC 29 ms
10,016 KB
testcase_04 AC 29 ms
10,016 KB
testcase_05 AC 29 ms
10,016 KB
testcase_06 AC 28 ms
10,016 KB
testcase_07 AC 28 ms
10,016 KB
testcase_08 WA -
testcase_09 AC 29 ms
10,016 KB
testcase_10 AC 28 ms
10,016 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 28 ms
10,016 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

x, y, z = map(int, input().split())
sum = x + 10 * y
y_10, x_10 = divmod(sum, 10)
if x == z and y ==0:
    print('Impossible')
    exit()
if y == 0:
    if x < z:
        print('Impossible')
        exit()
elif x + y + 10 < z:
    print('Impossible')
    exit()
change_count = (z-y_10)//9
if change_count == 0:
    change_count = 1
print(y_10 - change_count + x_10 + change_count*10-z)
0