Rock2000's blog

By Rock2000, history, 4 years ago, In English

The first code is giving correct answer while second code is giving wrong answer. The only difference between these two codes is:
In the first code the return value is -2*inf in the getmax function while it is -inf in the second code. Can anybody please help me figure out what is the problem?
Link to Problem

Code 1
Code 2
  • Vote: I like it
  • -18
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
4 years ago, # |
  Vote: I like it +27 Vote: I do not like it

After wasting 5 minutes of looking at those codes, I submitted both codes and got AC twice... Come on, can't you double-check before posting your question in Codeforces?

  • »
    »
    4 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Thanks. I was getting wrong answer on my local machine because I was unknowingly copy pasting test cases without getting them to load properly. And I will try to avoid these kind of things.