fast printing in python

Правка en1, от duckduckMoose, 2020-07-21 15:14:48

Hi everyone. I was doing 203C. I managed to solve (link) the problem in O(n*log n) time (constraints: n<10^6). But I got TLE. I checked from the editorial and my approach was correct. I read some comments in the editorial suggesting not to use print function and use other methods to print, so I used 'sys.stdout.write'. But then also the problem isn't resolved. How can I print faster than sys.stdout.write?

Теги #python 3, #python, stdout, #round 203

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский duckduckMoose 2020-07-21 15:14:48 545 Initial revision (published)