結果
問題 | No.825 賢いお買い物 |
ユーザー | vwxyz |
提出日時 | 2022-09-07 03:11:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 326 ms / 2,000 ms |
コード長 | 1,022 bytes |
コンパイル時間 | 231 ms |
コンパイル使用メモリ | 82,688 KB |
実行使用メモリ | 90,752 KB |
最終ジャッジ日時 | 2024-05-01 21:00:47 |
合計ジャッジ時間 | 5,138 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 145 ms
89,856 KB |
testcase_01 | AC | 146 ms
89,728 KB |
testcase_02 | AC | 326 ms
90,752 KB |
testcase_03 | AC | 261 ms
90,752 KB |
testcase_04 | AC | 325 ms
90,628 KB |
testcase_05 | AC | 145 ms
90,240 KB |
testcase_06 | AC | 148 ms
90,368 KB |
testcase_07 | AC | 199 ms
90,624 KB |
testcase_08 | AC | 150 ms
90,496 KB |
testcase_09 | AC | 181 ms
90,664 KB |
testcase_10 | AC | 279 ms
90,624 KB |
testcase_11 | AC | 146 ms
90,624 KB |
testcase_12 | AC | 144 ms
90,368 KB |
testcase_13 | AC | 156 ms
90,368 KB |
testcase_14 | AC | 142 ms
89,856 KB |
testcase_15 | AC | 150 ms
90,624 KB |
testcase_16 | AC | 149 ms
90,624 KB |
testcase_17 | AC | 144 ms
89,856 KB |
testcase_18 | AC | 149 ms
90,496 KB |
testcase_19 | AC | 149 ms
90,368 KB |
testcase_20 | AC | 141 ms
89,968 KB |
testcase_21 | AC | 142 ms
89,728 KB |
ソースコード
import bisect import copy import decimal import fractions import heapq import itertools import math import random import sys import time from collections import Counter,deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap, 0, len(heap)-1) def _heappushpop_max(heap, item): if heap and item < heap[0]: item, heap[0] = heap[0], item heapq._siftup_max(heap, 0) return item from math import gcd as GCD read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines write=sys.stdout.write A,B,C=map(int,readline().split()) for ans in range(1,10**5): for a in range(A+1): for b in range(B+1): r=a+10*b-ans if r>=0 and r//10+r%10+A-a+B-b==C: break else: continue break else: continue break else: ans="Impossible" print(ans)