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 | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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