Hoa_Dau_Biec's blog

By Hoa_Dau_Biec, history, 6 months ago, In English

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/

Update : I found some hint to continue debugging, i will comeback to fixed this blog if after I solve it

 
 
 
 
  • Vote: I like it
  • +4
  • Vote: I do not like it

»
6 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Hoa_Dau_Biec (previous revision, new revision, compare).

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Hey Man.. I've been stuck into this question..But I'm getting TLE on the last test case which I'm unable to rectify. I've found similar problem on Codechef though but it still gives TLE. I've used the exact same logic of yours. If you've solved can you help me out.

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it