Submission #9878658


Source Code Expand

Copy
atcoder = {
    'name': 'answer',
    'file': 'answer.pyx',
    'doc': '''
# disutils language=c++
# -*- coding: utf-8 -*-
# begin answer
import sys
import cython
int32 = cython.typedef(cython.int)
int64 = cython.typedef(cython.longlong)
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
write = sys.stdout.write
def ii(): return int(readline())
def mi(): return map(int, readline().rstrip().split())
def li(): return list(readline().rstrip())
def lmi(): return list(map(int, readline().rstrip().split()))
def end(*arg): print(*arg); sys.exit()
# template

def main():
    N: int32
    Y: int32
    N, Y = mi()
    i: int32
    j: int32
    k: int32
    for i in range(Y // 10000, -1, -1):
        for j in range(N + 1 - i):
            k = N - i - j
            if (10000 * i + 5000 * j + 1000 * k == Y):
                print("{} {} {}".format(i, j, k))
                return
    print("-1 -1 -1")

if __name__ == '__main__':
    main()

''',
    'setup': '''
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize

setup(
    name="my_module",
    ext_modules=cythonize(
        Extension("answer",
                  sources=["answer.pyx"],
                  extra_compile_args=["-O3"],
                  language="c++",
                  )
    ),
    cmdclass={'build_ext': build_ext},
)
'''
}


if __name__ == '__main__':
    try:
        import answer
    except:
        import os
        import subprocess
        with open(os.path.join(os.path.dirname(__file__), atcoder['file']), 'w') as f:
            f.write(atcoder['doc'])
        with open(os.path.join(os.path.dirname(__file__), "setup.py"), 'w') as f:
            f.write(atcoder['setup'])
        subprocess.run(["python3.8", "setup.py", "build_ext", "--inplace"])
        exit(0)
    else:
        answer.main()

Submission Info

Submission Time
Task ABC085C - Otoshidama
User edamat
Language Python (3.8.2)
Score 300
Code Size 1967 Byte
Status
Exec Time 102 ms
Memory 9004 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
× 4
× 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 87 ms 8820 KB
a02 94 ms 8972 KB
a03 99 ms 8908 KB
a04 91 ms 8972 KB
b05 91 ms 8908 KB
b06 78 ms 8844 KB
b07 98 ms 8912 KB
b08 90 ms 8892 KB
b09 90 ms 9004 KB
b10 83 ms 8924 KB
b11 102 ms 8840 KB
b12 95 ms 8844 KB
b13 86 ms 8924 KB
b14 87 ms 8836 KB
b15 102 ms 8936 KB
b16 102 ms 8976 KB
b17 99 ms 8912 KB
b18 84 ms 8908 KB
b19 96 ms 8968 KB
b20 82 ms 8844 KB
b21 95 ms 8920 KB
b22 90 ms 8832 KB
b23 91 ms 8912 KB
b24 91 ms 8904 KB