Comments

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.

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++