Hi, I tried wrote the program for this problem and on CF testing it seems to be failing on 27th test case of 2nd test i.e.
4
0 -2 1 2
In my local this is giving the correct answer i.e.
1 0
On CF, the answer is coming as 2 0
for some reason. Not able to figure out the reason, any help would be appreciated!!
Below is the submission of the same:
https://mirror.codeforces.com/contest/1660/submission/263742365
Auto comment: topic has been updated by a.rjput (previous revision, new revision, compare).
If you remove 1 at the front and 0 at the back, the product will be -4. On the other hand, if you remove 2 at the front and 0 at the back the product will be 2, which is bigger.
oh ok, my bad
just look at the global variables which you have declared , carefully . there might be the case that your code is using values of some other previous test case.(test case 2 is using values of test case 1 which might be causing the issue).