結果

問題 No.825 賢いお買い物
ユーザー gojoTYgojoTY
提出日時 2019-05-26 02:09:05
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 325 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 11,740 KB
実行使用メモリ 10,008 KB
最終ジャッジ日時 2023-10-17 17:47:45
合計ジャッジ時間 1,612 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

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 x + y + 10 < z:
    print('Impossible')
    exit()
if y>z:
    print((y-z) * 10 + x)
else:
    change_count = (z-y_10)//9 + 1
    print(y_10 - change_count + x_10 + change_count*10-z)
0