結果

問題 No.825 賢いお買い物
ユーザー 👑 rin204rin204
提出日時 2021-08-26 17:20:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 392 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 82,288 KB
実行使用メモリ 76,552 KB
最終ジャッジ日時 2024-04-29 08:52:14
合計ジャッジ時間 2,218 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
52,864 KB
testcase_01 AC 43 ms
57,344 KB
testcase_02 AC 57 ms
71,040 KB
testcase_03 AC 54 ms
65,280 KB
testcase_04 AC 57 ms
71,040 KB
testcase_05 AC 52 ms
61,952 KB
testcase_06 AC 39 ms
51,948 KB
testcase_07 AC 52 ms
64,256 KB
testcase_08 WA -
testcase_09 AC 49 ms
61,184 KB
testcase_10 AC 62 ms
75,520 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 39 ms
51,584 KB
testcase_14 AC 39 ms
51,840 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 39 ms
51,968 KB
testcase_18 AC 63 ms
75,520 KB
testcase_19 WA -
testcase_20 AC 42 ms
53,248 KB
testcase_21 AC 40 ms
52,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, c = map(int, input().split())

for yen in range(1, a + b * 10 + 1):
    for i in range(a + 1):
        for j in range(b + 1):
            if i + 10 * j < yen:
                continue
            d = (i + 10 * j) - yen
            cnt = a - i + b - j + sum(map(int, str(d)))
            if cnt == c:
                print(yen)
                exit()
                
print('Impossible')
0