OneClickAC's blog

By OneClickAC, history, 9 years ago, In English

Can anyone tell me , why I am getting runtime error on test 1 itself ?? Problem link->http://mirror.codeforces.com/problemset/problem/387/B Code link->http://pastebin.com/N3JKSVPj

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

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

Run it through valgrind and you'll see a bunch of invalid read errors. You need to advance the iterator before you erase the element from the set. You can use the return value from set.erase() like this.