WA in CHPINTU

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

Work’s fine and executes but on submission throws an error as wrong answer

1 Like

Bro, Just add ( int min =Integer.MAX_VALUE; )
inside the while loop of t you will get AC!

this is your AC code- CodeChef: Practical coding for everyone

You were not initializing min to Integer.MAX_VALUE for every test case!

Thanks will try it and let you know…
Thanks for the help

1 Like

Tried it dude still stuck with same error Can you please tell me what’s wrong with my while loop correcting that prompts me right answer

Please help me out Thanks in advance.
@anon61233355
Here’s the sample code:
https://www.codechef.com/viewsolution/30587257

What would happen if t=1000?

I have even tried <= 1000 still throws a wrong answer @everule1

??
https://www.codechef.com/viewsolution/30588661

Sorry Sorry!!!.. :sweat_smile: :sweat_smile: :sweat_smile:

You just write while(t!=0) for the test case or while(t>0 && t<=1000).
if t=1000 your code will have WA.

1 Like

Just see the solution i posted.This is your solution but i edited and got an AC.

1 Like