結果
問題 |
No.825 賢いお買い物
|
ユーザー |
|
提出日時 | 2020-04-20 21:27:32 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 732 bytes |
コンパイル時間 | 197 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-06 09:15:26 |
合計ジャッジ時間 | 1,759 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 10 WA * 9 |
ソースコード
INF = 10 ** 9 import sys sys.setrecursionlimit(100000000) dy = (-1,0,1,0) dx = (0,1,0,-1) from collections import deque def main(): a,b,c = map(int,input().split()) if c - b <= 0: ans = a + 10 * (b - c) else: c -= b if a >= 10 * c: ans = a - 10 * c elif a < c: ans = 'Imossible' else: s = a//10 flag = False while s > -1: if a - 10 * s - (c - s) > 1: ans = a - 10 * s - (c - s) flag = True break s -= 1 if flag == False: ans = 'Impossible' print(ans) if __name__ == '__main__': main()