farukshin's blog

By farukshin, history, 5 years ago, In English

Can't figure out how to implement Set operation.

Everything is clear with the operations Add, Sum, Min, Reverse, Revolve, Insert, Delete

  • Vote: I like it
  • -3
  • Vote: I do not like it

| Write comment?
»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
5 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

why do you care?

»
5 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

Just split the treap around the value to be removed, insert a new treap with the new value and merge the three treaps.