結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,424 KB
testcase_01 AC 70 ms
71,604 KB
testcase_02 AC 74 ms
71,460 KB
testcase_03 AC 70 ms
71,576 KB
testcase_04 AC 70 ms
71,484 KB
testcase_05 AC 68 ms
71,348 KB
testcase_06 AC 71 ms
71,360 KB
testcase_07 AC 69 ms
71,376 KB
testcase_08 WA -
testcase_09 AC 69 ms
71,456 KB
testcase_10 AC 70 ms
71,456 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 69 ms
71,500 KB
testcase_14 AC 70 ms
71,312 KB
testcase_15 AC 71 ms
71,460 KB
testcase_16 WA -
testcase_17 AC 71 ms
71,676 KB
testcase_18 WA -
testcase_19 AC 70 ms
71,480 KB
testcase_20 AC 71 ms
71,428 KB
testcase_21 AC 71 ms
71,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

okn = a+b*10

for i in range(1,okn+1):
    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