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 | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | 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://codeforces.me/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.