Why is this submission so slow? D2. DFS Checker (Hard Version)

Правка en1, от neal, 2024-08-11 22:52:24

Can anyone tell me why this submission is so slow? 275858049

It's $$$\mathcal{O}(N + Q)$$$ and should be very fast, but somehow it takes 1125 ms.

Meanwhile my in-contest code that uses lots of sets and does a bunch of nonsense only takes 561 ms: 275858229

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский neal 2024-08-11 22:52:24 345 Initial revision (published)