Can't figure out how to implement Set operation.
Everything is clear with the operations Add, Sum, Min, Reverse, Revolve, Insert, Delete
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3773 |
3 | Radewoosh | 3646 |
4 | ecnerwala | 3624 |
5 | jqdai0815 | 3620 |
5 | Benq | 3620 |
7 | orzdevinwang | 3612 |
8 | Geothermal | 3569 |
8 | cnnfls_csy | 3569 |
10 | gyh20 | 3447 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | awoo | 161 |
2 | maomao90 | 160 |
3 | nor | 157 |
4 | atcoder_official | 156 |
4 | cry | 156 |
6 | -is-this-fft- | 155 |
7 | maroonrk | 154 |
8 | adamant | 153 |
9 | Um_nik | 151 |
10 | djm03178 | 146 |
Can't figure out how to implement Set operation.
Everything is clear with the operations Add, Sum, Min, Reverse, Revolve, Insert, Delete
Название |
---|
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.