Can't figure out how to implement Set operation.
Everything is clear with the operations Add, Sum, Min, Reverse, Revolve, Insert, Delete
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Can't figure out how to implement Set operation.
Everything is clear with the operations Add, Sum, Min, Reverse, Revolve, Insert, Delete
Name |
---|
I am little confused about your query , by set operations do u mean union, intersection operations or normal unique value or just sorted nature or both sorted and unique.
Anyways see if this helps
https://mirror.codeforces.com/blog/entry/46507
Thanks for the link
e.g. task https://www.e-olymp.com/en/problems/2307
But I wanted to understand — is it possible to solve using a Treap by an implicit key?
Can you implement the same operation using segment tree nodes with lazy propagation if yes, you can do the same for treap nodes with log(n) amortized complexity or average I guess. Ping me if you need implementation link of the same.
why do you care?
Just split the treap around the value to be removed, insert a new treap with the new value and merge the three treaps.