Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Doubt in Sliding Window Median CSES problem

Правка en1, от Surge226, 2024-07-03 19:58:00

Hello everyone, I am trying to do Sliding Window Median problem from CSES. I have thought of multiset approach which is pretty close to one of its solutions and wrote this peice of code.

My Code

When I ran it on larger test case, it is taking this much time.

real    0m50.343s
user    0m50.003s
sys     0m0.195s

And, on the running the USACO solution, following same approach.

USACO solution

It is taking this much time.

real    0m1.396s
user    0m1.178s
sys     0m0.214s

Now, I am not able to understand that why the time taken is increasing so drastically, even though the complexities are same. I can share the complete code also if it would help. Thanks

Теги sliding window, cses

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Surge226 2024-07-03 19:58:00 2661 Initial revision (published)