### Pratik_'s blog

By Pratik_, history, 6 weeks ago,

I want to know why this error is occurs every time I try to run my code in codeforces. My code runs fluently in my PC but it's not running in cf editor. this is my submission : https://codeforces.com/contest/1433/submission/96685161

• -2

 » 6 weeks ago, # |   0 There is something wrong with the 1st line of main function. I faced similar problem with using that line on some other oj. I don't know what is the problem on that line under the hood, but you can use scanf/printf instead of that line. (Comment that line and submit again.)
 » 6 weeks ago, # |   +11 ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); unties c-style io from cin. As a result you can't use both of them or you'll get weird behavior. In general you should always know what your template is doing. Otherwise if you just blindly paste you'll run into nasty errors like this.
 » 6 weeks ago, # |   0 I tried using scanf and then I got this https://codeforces.com/contest/1433/submission/96746653
•  » » 6 weeks ago, # ^ |   0 You're still using cin >> n inside of solution.
•  » » 6 weeks ago, # ^ |   0 You're still using cin in solution function as cin>>n;. You should use scanf only for the entire program. Actually, if you're going to use scanf, it's better to erase ios_base::sync_with_stdio(0) since it's useless anymore.
 » 6 weeks ago, # |   0 Thanks I got that