結果

問題 No.825 賢いお買い物
ユーザー rythem00359rythem00359
提出日時 2020-08-17 13:34:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-19 18:47:50
合計ジャッジ時間 1,566 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,624 KB
testcase_01 AC 27 ms
10,752 KB
testcase_02 AC 34 ms
10,752 KB
testcase_03 AC 27 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 26 ms
10,624 KB
testcase_06 AC 26 ms
10,624 KB
testcase_07 AC 27 ms
10,752 KB
testcase_08 AC 42 ms
10,624 KB
testcase_09 AC 26 ms
10,752 KB
testcase_10 AC 36 ms
10,624 KB
testcase_11 AC 37 ms
10,624 KB
testcase_12 AC 27 ms
10,752 KB
testcase_13 AC 26 ms
10,624 KB
testcase_14 AC 26 ms
10,624 KB
testcase_15 AC 33 ms
10,624 KB
testcase_16 AC 31 ms
10,752 KB
testcase_17 AC 24 ms
10,624 KB
testcase_18 AC 41 ms
10,624 KB
testcase_19 AC 28 ms
10,624 KB
testcase_20 AC 25 ms
10,624 KB
testcase_21 AC 25 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c=map(int,input().split())
def calc(v,x,y):
    z=x*10+y-v
    return a-x+b-y+(z//10+z%10)
ans='Impossible'
for i in range(1,b*10+a+1):
    for j in range(b+1):
        for k in range(a+1):
            if calc(i,j,k)==c:
                ans=i
                break
        else:continue
        break
    else:continue
    break
print(ans)
0