It seems you a problem here: ‘if (!v[j]) res++;’, you will update res for every empty interval more than once.
But I think that even if there are no other problems, you still get TLE
@boochman , I still don’t think that’s a problem, as after bursting if a box has zero ballons, then if the position of box lies in any range , it will be coming just for once only and there will be no more update for res than the required case.
But it will still get TLE, but WA I still don’t get it. xD
v[j] stays = 0. then in next time a[p] will be equal to 0, for p not in the range [r[j].l, r[j].r], v[j] is still = 0, and then res++
can u provide me a test case i m not getting it
I know i will get TLE but WHY WA strange…
oops, I guess I didn’t notice ‘res = 0;’. so me too can’t find the problem
same here unable to identify…