Why don't they allow me using NUMPY? and why are the libraries of C++ allowed, if python is not allowed?
| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3657 |
| 3 | jiangly | 3638 |
| 4 | turmax | 3442 |
| 5 | tourist | 3380 |
| 6 | Um_nik | 3353 |
| 7 | strapple | 3350 |
| 8 | squareOf105 | 3346 |
| 9 | heuristica | 3322 |
| 10 | maroonrk | 3310 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | nik_exists | 151 |
| 3 | maspy | 150 |
| 4 | AmShZ | 143 |
| 4 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | adamant | 137 |
| 8 | BledDest | 134 |
| 9 | maroonrk | 133 |
| 10 | qwexd | 130 |
Why don't they allow me using NUMPY? and why are the libraries of C++ allowed, if python is not allowed?
| Название |
|---|



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?
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.