Why don't they allow me using NUMPY? and why are the libraries of C++ allowed, if python is not allowed?
# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
Why don't they allow me using NUMPY? and why are the libraries of C++ allowed, if python is not allowed?
Name |
---|
It is slow
Cpp with STL is 9x faster than Python. But writing python code is very easy
Practically all problems < 2200 can be solved using python (and not like 1996/2000 ms.) Of course you must use FAST IO and use pypy_64
I do CP mostly in Python but sometimes I have to switch to C++ because I know the same code which gave a TLE in Python would sometimes give an accepted solution in C++.
Most recent experience:
212573964 Python for 1846A
212577305 C++ for 1846A
It's like the exact same code in two different languages. It happened quite a few times. So, if you are just starting to do CP, I suggest starting with C++
I copied your python code and submit it as Python 3 (not PyPy 3-64) and it was Accepted (took only 734ms) 213292103. Somehow Python 3 runs faster than PyPy 3-64.
Add the following code at the top:
import sys
input = lambda: sys.stdin.readline().rstrip() # faster!
Yeah, I know it works. In fact I submitted a solution later with these lines added. But my point just is that it's a very simple problem with direct implementation and it should have worked without using sys for fast input. This is the first time I encountered something like this in an 800 problem.
Just tested it without the fast input, and you are right. I suspect that this might have to do with the fact that the input is split across many lines rather than a few long lines. Not ideal for an A problem indeed, especially in a D3 round.
because
Why are turtles slower than Bolt?
i like eat turtle.
Because NumPy is not a Python built-in library.
good question, i'd like to have numpy and scipy allowed.
In that case, they may at least add support for Eigen, which is a C++ library for linear algebra.