jmrh_1's blog

By jmrh_1, history, 6 years ago, In English

Hello for everyone in codeforces. In this last contest I sent two identical solutions only , one gave me Wrong Answer in test case 1, although in my computer it was good but I sent that same solution with one more command (cout << "";) which I see insignificant and should not vary the result and gives Accepted . I do not know what could have happened, please could you help me understand my mistake. Thank you in advance.

these are my shipments :

1-Wrong Answer in test case one

2-Accepted

  • Vote: I like it
  • -16
  • Vote: I do not like it

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

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

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

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

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

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

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

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

»
6 years ago, # |
  Vote: I like it +13 Vote: I do not like it

You probably have undefined behavior somewhere. Try running it in a debugger.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    pos is uninitialized when this line executes: if (k > pos) { cout << "NO"; }.