I submitted [this](https://codeforces.com/contest/1391/problem/A) solution to Problem A of Round #663. I know the problem was really easy and even my logic was correct. What actually caused problems was including the following two line in my `void solve()` function.↵
↵
~~~~~↵
ios_base::sync_with_stdio(false);↵
cin.tie(NULL);↵
~~~~~↵
↵
I added the two lines for fast input/output through cin/cout but mistakenly added them to `void solve()`. However, after removing these two lines the code worked fine and got accepted.<br>↵
[Link](https://codeforces.com/contest/1391/submission/89409962) to first solution.<br>↵
[Link](https://codeforces.com/contest/1391/submission/89414561) to second solution.↵
↵
Can someone please explain what exactly went wrong and why?<br>↵
Thanks in advance!!↵
<br> UPD: Not here for contributions. Plz just answer it if you know the answer.↵
↵
↵
~~~~~↵
ios_base::sync_with_stdio(false);↵
cin.tie(NULL);↵
~~~~~↵
↵
I added the two lines for fast input/output through cin/cout but mistakenly added them to `void solve()`. However, after removing these two lines the code worked fine and got accepted.<br>↵
[Link](https://codeforces.com/contest/1391/submission/89409962) to first solution.<br>↵
[Link](https://codeforces.com/contest/1391/submission/89414561) to second solution.↵
↵
Can someone please explain what exactly went wrong and why?<br>↵
Thanks in advance!!↵
<br> UPD: Not here for contributions. Plz just answer it if you know the answer.↵
↵