結果

問題 No.825 賢いお買い物
ユーザー vwxyzvwxyz
提出日時 2022-09-07 03:10:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,859 ms / 2,000 ms
コード長 1,022 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 90,792 KB
最終ジャッジ日時 2024-05-01 21:00:30
合計ジャッジ時間 10,677 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 145 ms
89,528 KB
testcase_01 AC 125 ms
89,488 KB
testcase_02 AC 1,859 ms
90,300 KB
testcase_03 AC 1,230 ms
90,592 KB
testcase_04 AC 1,727 ms
90,496 KB
testcase_05 AC 126 ms
90,136 KB
testcase_06 AC 153 ms
90,624 KB
testcase_07 AC 584 ms
90,452 KB
testcase_08 AC 136 ms
90,792 KB
testcase_09 AC 391 ms
90,624 KB
testcase_10 AC 1,309 ms
90,676 KB
testcase_11 AC 134 ms
90,584 KB
testcase_12 AC 127 ms
90,240 KB
testcase_13 AC 164 ms
90,752 KB
testcase_14 AC 125 ms
89,628 KB
testcase_15 AC 133 ms
90,496 KB
testcase_16 AC 134 ms
90,584 KB
testcase_17 AC 131 ms
89,524 KB
testcase_18 AC 133 ms
90,448 KB
testcase_19 AC 133 ms
90,612 KB
testcase_20 AC 131 ms
89,592 KB
testcase_21 AC 124 ms
89,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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**6):
    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)
0