Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя a.rjput

Автор a.rjput, история, 4 месяца назад, По-английски

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://codeforces.net/contest/1660/submission/263742365

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
4 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by a.rjput (previous revision, new revision, compare).

»
4 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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.

»
4 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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).