Language Update As a crew member, I was able to try Cython in the new judge test environment, so I tried it. By the way, what is the first time I touched Cython? I don't even know (laughs)
By the way, Python 3 after the language update is 3.8.0 and Cython is 0.29.14.
ABC085C --I tried it with Otoshidama. I submitted the source code that was AC at 678 ms with Python 3 as it is with Cython and AC at 614 ms.
from sys import exit
N, Y = map(int, input().split())
for i in range(N + 1):
for j in range(N + 1 - i):
k = N - i - j
if 10000 * i + 5000 * j + 1000 * k == Y:
print('%d %d %d' % (i, j, k))
exit()
print('-1 -1 -1')
Didn't you think that Python 3 would be penalized with RE even though the compilers were CE and no penalties even with a sloppy typo? Cython would be CE.
If you try to delete the = in the first assignment statement, you will get an error like this.
Error compiling Cython file:
------------------------------------------------------------
...
from sys import exit
N, Y map(int, input().split())
^
------------------------------------------------------------
Main.py:3:6: Syntax error in simple statement list
./Main.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
1 | #error Do not use this file, it is the result of a failed Cython compilation.
| ^~~~~
Looking at the Cython documentation, it seems like I need two source codes, like writing a .pyx file, compiling it, and importing and using it in .py, so I didn't know how to use it at first. Cython has Pure Python Mode, which seems to be used by AtCoder.
As a result, AC. 6 times faster in 107ms !!
from cython import longlong
def main():
N: longlong
Y: longlong
N, Y = map(int, input().split())
i: longlong
j: longlong
for i in range(N + 1):
for j in range(N + 1 - i):
k: longlong = N - i - j
if 10000 * i + 5000 * j + 1000 * k == Y:
print('%d %d %d' % (i, j, k))
return
print('-1 -1 -1')
if __name__ == '__main__':
main()
After the language update, PyPy 3 was 7.3.0, AC at 150ms. However, the memory consumption was significantly increased to 64MB compared to 8.7MB for Python 3 / Cython.