Problem Link:
My Submission:
CodeChef: Practical coding for everyone
Can anyone tell what’s wrong? i applied the same logic with the help of sets and it worked?
Problem Link:
My Submission:
CodeChef: Practical coding for everyone
Can anyone tell what’s wrong? i applied the same logic with the help of sets and it worked?
In insert query, the elements aren’t necessarily given in increasing order, hence query 3 fails
We are supposed to do upper bound right to find the smallest element strictly greater than the element in the set ,
I tried doing lower bound and it also gave AC
Why ? Are the testcases weak ? Or it is said somewhere z wont be equal to any of the elements in the set ?
Thanks
https://www.codechef.com/viewsolution/29294881
Even i am facing problem in this ques… can anyone plz tell why my code doesn’t give an AC!?
Oh! is it? lower_bound is wrong… Can u share the AC code?
Oh… That must mean z is not a element present in the set. I guess it’s just weak test cases then
It is because you are printing YES and not Yes and same for No
Change that and that would probably give AC
but its now giving runtime error …
plz have a look at my code and suggest possible changes