On a recent contest, i submitted a problem for many times but it shows runtime error. I have checked it in many online g++ compiler. It runs well but codeforces shows runtime error verdict. .
- my code link is : sol_of_mine
- and problem link is : problem a
For (it = s.begin(); it != s.end(); it++)
If ... s.erase(it)
Here is a mistake. you are not allowed to change the size of your set in FOR loop. be careful and use debugger