AFK - Editorial

Test case found
1
0 -1 -5
Your code give 1 but answer is 2

@aryanc403 , its giving 2 only

1 Like

Try this test case

2

0 10 1

0 -10 -1

Its giving correct answer. I think there is some issue with the large numbers because WA was there for subtask 2, subtask 1 was correct

Ok. Then what is your approach to deal with large no ??

My approach here - AGdtqY - Online C++0x Compiler & Debugging Tool - Ideone.com
Do look only when you tried all method yourshelf.

But only look it after looking above pseudo code and trying it yourshelf.
Most probably you will not need below code.

This was my hint of dealing +ve and -ve value separately.

Your AC (100 pts) edited soln CodeChef: Practical coding for everyone here. :slight_smile: Happy coding.

P.S.
When I was giving test case where your code was giving correct answer. I was running your old code And it was giving incorrect ans. :slight_smile:
Specially Last two times and you found it to give correct answer.

Bonus karma’s for your effort. :slight_smile: Happy Coding :slight_smile:

After your hint, I also thought of something like that but was unable to come up with the condition (a+b<0) which actually made all that difference from WA to AC :slight_smile:
Thanks a lot @aryanc403 for working out with my code and finding the bug :slight_smile:

1 Like

Tests are valid T = 10000 and 1 + 10000 lines in both

I think it is not valid.
See this,
https://www.codechef.com/viewsolution/18045841

I changed the loop condition and it passed.

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

1.in has 10000 tests and 10001 lines, I don’t where is the problem. Let me check