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 | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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.