Hey everyone, how are you?
I am getting Time limit in this problem with a complexity of O(n log n) n<=10^5. I tried to see if something is overlapping, but couldn't find any. Thanks everyone.
And sorry for my bad English.
submission link: http://codeforces.net/contest/675/submission/18651358. Organized code Link: https://codeshare.io/leZMR
is O(N) for std :: set, use
and you will get WA 6.