Help with Treap ( Again :( )

Правка en1, от hielitos, 2019-11-25 09:14:39

Hi Codeforces, 5 month ago i asked for your help and meooow could solve my problem, thank you again for that :D.

Sadly, i have a new problem that i can't solve by myself. ( I'm still trying to solve it )

This time is with D1 and D2 problems from the last contest ( Codeforces Round #602 (Div. 2, based on Technocup 2020 Elimination Round 3 ).

I made a solution that i think it should pass both D1 and D2 problems but i'm getting Memory limit exceeded on test 10.

Here is my submission from D1 code. The difference from D2 are the lines 89-91 because of the limits ( I only did this because i didn't know what else to do :( ).

I think that my idea it's quite complicated to explain ( at least for me ), but i am working on it, maybe knowing what my code does someone would be able to help me..

But, as i can see i only do $$$N$$$ insertions to the Treap and $$$N$$$ insertions to an auxiliary priority queue, i don´t have idea why i´m getting memory limit.

I will appreciate any comment. Thank you :D

Теги treap, treaps, #implementation, #debug, #help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский hielitos 2019-11-25 09:48:21 335 Tiny change: 'nly change the way o' -> 'nly changed the way o'
en1 Английский hielitos 2019-11-25 09:14:39 1265 Initial revision (published)