why my code is not accepted althought it is correct please help

https://www.codechef.com/viewsolution/20470321

I guess you misunderstood the problem, it says “find out whether Chef will like at least one dish”. No need to count anything, if one dish has a >= x then it’s a “Yes” or in your method if temp == 0, don’t forget to reset its value when you get a new n value.

//