Hello,
This is an interesting data structure problem.
It can't be solved with regular insertion and print.
Who do you think it can be solved ??
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3821 |
3 | Benq | 3736 |
4 | Radewoosh | 3631 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3388 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
Hello,
This is an interesting data structure problem.
It can't be solved with regular insertion and print.
Who do you think it can be solved ??
Name |
---|
Rope will do just fine.
it's very nice, I understood most of what I read, but I couldn't find any more tutorial's,explanations, and implementation for it.
Do you have any ??
look here: https://www.sgi.com/tech/stl/Rope.html, you can use it with some c++ compilers..
Thanks, I wanted to see full implementation but this is enough now :D
is there any other data structures with log(n) time insert delete and range query ??
Treap?
hello Just-yousef
This problem is already asked in lunch time contest on codechef. you can check this link for more details here. You can check the editorial for the detail explanation of the solution to this problem.
Here are the steps to solve this problem. 1. First find the final string after all insertion. ( Think on this ) 2. Now process queries in the reverse order and a simple rank based segment tree will help you to answer each query.
I have written just to guide you. If u find anything that is not understandable from the available editorial just reply on this thread. I will be more happy to help you.
thanks, I've read the tutorial and I understood it, but I need to improve mu knowledge of BIT first.
Thanks :D
Hello JUST_Yousef,
Have you understood the solution of this problem ? This problem was seriously one of the most interesting problem. If you got the solution correctly try this one from the codeforces discussion here