Help needed in Substring reversals on CSES

Revision en1, by Hoa_Dau_Biec, 2021-03-18 19:08:54

Hi guy, I have been doing this problem : https://cses.fi/problemset/task/2073/

Given a string and m query which request reverse a substring. Print the final string

I solve it by Treap but I got Undefine Behavior (I run my code on my laptop and got correct answer, but on CSES is not). I was trying to fix it for six hour's but it's not better. Please tell me what was wrong in my code, thank you a ton!

Here is my code : https://cses.fi/paste/695ccf4c2fc0a9521c5235/

Tags #cses, implicit treap

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Hoa_Dau_Biec 2021-03-18 22:04:57 108
en1 English Hoa_Dau_Biec 2021-03-18 19:08:54 517 Initial revision (published)