STL Help Required

I’m comparing two vectors in C++ stl for equality;

vector x,y;

using x==y

but getting WA on codechef;

I tried many cases using random generator but working on all.

Consider this link for the code.

I’ve done this many times before but never got WA.

What could be the reason here?

Btw this could be the only problem because when I did the checking manually it got me an AC.

I think there is no problem with STL.
Problem is with your logic.
Try this test Case
4 3
0 0 0 0
0 0
The correct answer is bob but your code output alice.
push a only in vector when a > 0. It will give correct answer


Damn I didn’t see the constraints for the possibility of 0 :frowning:

1 Like

I also get a penalty for this. then I see the constraints and realize that we have heaps that contain 0 stone. seriously who call them a heap. just amazing

1 Like