結果

問題 No.825 賢いお買い物
ユーザー brthyyjpbrthyyjp
提出日時 2021-05-06 19:15:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 76,688 KB
最終ジャッジ日時 2023-10-12 11:40:44
合計ジャッジ時間 2,940 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
76,148 KB
testcase_01 AC 81 ms
76,540 KB
testcase_02 AC 74 ms
76,056 KB
testcase_03 AC 75 ms
75,984 KB
testcase_04 AC 74 ms
76,044 KB
testcase_05 AC 80 ms
75,968 KB
testcase_06 AC 71 ms
71,416 KB
testcase_07 AC 76 ms
75,796 KB
testcase_08 AC 80 ms
76,528 KB
testcase_09 AC 72 ms
71,368 KB
testcase_10 AC 73 ms
75,792 KB
testcase_11 AC 77 ms
75,956 KB
testcase_12 AC 73 ms
76,044 KB
testcase_13 AC 67 ms
71,372 KB
testcase_14 AC 72 ms
76,008 KB
testcase_15 AC 77 ms
76,136 KB
testcase_16 AC 79 ms
76,120 KB
testcase_17 AC 71 ms
75,748 KB
testcase_18 AC 74 ms
76,688 KB
testcase_19 AC 75 ms
76,176 KB
testcase_20 AC 71 ms
71,384 KB
testcase_21 AC 72 ms
71,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, c = map(int, input().split())
ans = 10**18
for i in range(a+1):
    for j in range(b+1):
        x = i+10*j
        if x == 0:
            continue
        R = a-i+b-j
        for y in range(1, x+1):
            z = x-y
            q, r = divmod(z, 10)
            if R+q+r == c:
                ans = min(ans, y)
if ans != 10**18:
    print(ans)
else:
    print('Impossible')
0