結果

問題 No.825 賢いお買い物
ユーザー stngstng
提出日時 2022-07-09 16:22:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 543 bytes
コンパイル時間 435 ms
コンパイル使用メモリ 87,292 KB
実行使用メモリ 71,628 KB
最終ジャッジ日時 2023-08-29 23:54:23
合計ジャッジ時間 3,529 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,584 KB
testcase_01 AC 66 ms
71,412 KB
testcase_02 AC 71 ms
71,460 KB
testcase_03 AC 69 ms
71,344 KB
testcase_04 AC 71 ms
71,324 KB
testcase_05 AC 81 ms
71,336 KB
testcase_06 AC 69 ms
71,172 KB
testcase_07 AC 68 ms
71,548 KB
testcase_08 WA -
testcase_09 AC 68 ms
71,592 KB
testcase_10 AC 69 ms
71,452 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 70 ms
71,344 KB
testcase_14 AC 71 ms
71,176 KB
testcase_15 AC 72 ms
71,628 KB
testcase_16 WA -
testcase_17 AC 70 ms
71,324 KB
testcase_18 WA -
testcase_19 AC 70 ms
71,364 KB
testcase_20 AC 74 ms
71,476 KB
testcase_21 AC 67 ms
71,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

okn = a+b*10

for i in range(1,okn):
    if i % 10 <= a:
        kk = (a-(i%10))+b-(i//10)
        if kk == c:
            print(i)
            exit()
    if i % 10 != 0:
        if (i//10)+1 <= b:
            kk = b-((i//10)+1) + a + (10-(i%10))
            if kk == c:
                print(i)
                exit()
    for j in range(2):
        ryo = i+10*(j+1)
        if ryo <= a:
            kk = a-ryo+j+1+b
            if kk == c:
                print(i)
                exit()

print("Impossible")
0