Hello there
so I'm trying to solve this problem
It's about finding the gcd of a set of numbers where i insert and delete numbers from the set
I already solved it with a segment tree, and after learning about treas i tried solving it with a treap but it TLEd on testcase 18
now my question is: aren't treaps on average Log(n)? if so ... shouldn't it pass where segment tree did with complexity of stable Log(n)?
here's my treap code for reference for maybe the error is in my implementation