Problem for Treaps.
My solution (using Treap for every type of vegetable): https://ideone.com/te9lsN
PLEASE, help me find what am I missing.
I debug it at least 5 times and I overthinked it… every corner case and etc.
I’ve been torturing myself for a week now. I just can’t explain why WA on Test Case 15?
I can’t help with your problem, but don’t assume you’ve got test cases 1-14 correct. SPOJ doesn’t stop processing on the first WA, and will process all test cases before giving a WA verdict.
I found the mistake! I didn’t update cnt after erase function.
Sorry for bothering and 10x for the advise though.