Submission #4668999


Source Code Expand

from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


inf = float('inf')


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_list_of_int():
    return [int(i) for i in input().split()]


def get_list_of_float():
    return [float(f) for f in input().split()]


def get_list_of_char():
    return list(input().strip())


def get_data(n, order=None, **kwargs):
    if not order:
        order = range(len(kwargs))
    it = iter(order)
    var, fn = zip(*sorted(sorted(kwargs.items()), key=lambda _: next(it)))

    rows = []
    for _ in range(n):
        rows.append(input().split())
    columns = zip(*rows)
    exec("global "+", ".join(var)+"\n"+"\n".join(
        v+"=list(map(fn[{}], data[{}]))".format(i, i)
        for i, v in enumerate(var)),
        globals(),
        {"fn": list(fn), "data": list(columns)}
    )
    return


# inputs
N, Y = 0, 0


def set_inputs():
    global N, Y
    N, Y = get_list_of_int()
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    for i, j in itertools.combinations(range(N+2), 2):
        x, y, z = i, j - i - 1, N - j + 1
        if x * 10000 + y * 5000 + z * 1000 == Y:
            print(x, y, z)
            break
    else:
        print(-1, -1, -1)
    return


if __name__ == '__main__':
    main()

Submission Info

Submission Time
Task C - Otoshidama
User nakario
Language PyPy3 (2.4.0)
Score 300
Code Size 1676 Byte
Status AC
Exec Time 255 ms
Memory 40300 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 24
Set Name Test Cases
Sample a01, a02, a03, a04
All a01, a02, a03, a04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24
Case Name Status Exec Time Memory
a01 AC 166 ms 38384 KB
a02 AC 165 ms 38256 KB
a03 AC 171 ms 38896 KB
a04 AC 242 ms 40300 KB
b05 AC 165 ms 38256 KB
b06 AC 164 ms 38256 KB
b07 AC 164 ms 38256 KB
b08 AC 165 ms 38384 KB
b09 AC 237 ms 40300 KB
b10 AC 238 ms 40300 KB
b11 AC 238 ms 40300 KB
b12 AC 163 ms 38384 KB
b13 AC 168 ms 38640 KB
b14 AC 171 ms 38844 KB
b15 AC 236 ms 40300 KB
b16 AC 233 ms 40300 KB
b17 AC 234 ms 40300 KB
b18 AC 162 ms 38256 KB
b19 AC 166 ms 38512 KB
b20 AC 167 ms 38768 KB
b21 AC 239 ms 40300 KB
b22 AC 255 ms 40300 KB
b23 AC 238 ms 40300 KB
b24 AC 252 ms 40300 KB