I’ve written this code for the COVID19 pandemic problem, but isn’t giving the correct answer. Could anyone help me figure out? If possible can I get a test case where this runs wrong???
Thank you.
https://www.codechef.com/viewsolution/31954816
Your code fails for this test case :
6
1 0 0 0 0 1
Answer should be NO but your code is giving YES.
It gives NZEC for the following case :
100
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
However the answer should be NO
Also, you don’t need to check if the constraints match or not. They are guaranteed to be according to the given constraints.