venkycodes's blog

By venkycodes, history, 5 years ago, In English

My submission https://mirror.codeforces.com/contest/1148/submission/55003775 is getting runtime error on testcase 43 . But the same submission is giving correct answer on other online ide's like online gdb . Please someone look into it .

  • Vote: I like it
  • 0
  • Vote: I do not like it

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

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

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

The standard answer: Run your code in custom invocation and debug there.

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

Checker comment: Exit code is 1

......
            if(f) pos=posb+k-x;
            else {cout<<-1; return 1; }
......

you should return 0 but not 1

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

use return 0 , in line 53 … replace of return 1 ;