結果

問題 No.825 賢いお買い物
ユーザー titiatitia
提出日時 2019-05-03 21:29:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 76,652 KB
最終ジャッジ日時 2023-08-30 05:56:14
合計ジャッジ時間 3,282 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
76,192 KB
testcase_01 AC 84 ms
76,488 KB
testcase_02 AC 79 ms
75,936 KB
testcase_03 AC 81 ms
75,636 KB
testcase_04 AC 80 ms
76,084 KB
testcase_05 AC 83 ms
76,320 KB
testcase_06 AC 75 ms
71,084 KB
testcase_07 AC 78 ms
75,960 KB
testcase_08 AC 84 ms
76,580 KB
testcase_09 AC 79 ms
75,800 KB
testcase_10 AC 81 ms
76,268 KB
testcase_11 AC 85 ms
76,480 KB
testcase_12 AC 80 ms
76,280 KB
testcase_13 AC 74 ms
71,140 KB
testcase_14 AC 80 ms
76,400 KB
testcase_15 AC 82 ms
76,272 KB
testcase_16 AC 86 ms
76,652 KB
testcase_17 AC 80 ms
75,820 KB
testcase_18 AC 87 ms
76,524 KB
testcase_19 AC 85 ms
75,900 KB
testcase_20 AC 79 ms
75,872 KB
testcase_21 AC 77 ms
71,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,C=map(int,input().split())

def rest(i,j,money):
    otsuri=i+10*j-money

    return otsuri//10+otsuri%10

ANS=[]
for i in range(A+1):
    for j in range(B+1):
        if i+j==0:
            continue

        for money in range(1,i+10*B+1):
            otsuri=rest(i,j,money)
            if otsuri+(A-i)+(B-j)==C:
                ANS.append(money)


if len(ANS)>0:
    print(min(ANS))
else:
    print("Impossible")
0