### bfs.07's blog

By bfs.07, history, 7 months ago, ,

I think it's very bad when we try to submit a problem fully implemented in C++ language, in the expected complexity, and we get a time limit exceeded verdict. Then, we realize we have used default readings and writing commands from C++ (cin/cout), and we try to change every occurrence to faster ones. I really don't like these kind of problems with a very tight time limit. Because of this, I've created a new tool called Fast I/O Code Optimizer. This tool is very simple and it was built to prevent the users from replacing all cin/cout commands to new ones.

To use this optimizer you only need to access the website fastio.pythonanywhere.com and follow a few steps. After accessing the website, it is needed to insert the code to be optimized in the text field from the left, then click the button Optimize it and it's done, the optimized code will be pasted in the text field from the right.

In tests, after using this tool, the execution time performance improved up to 50%. This program can also be very important in an online competition to prevent wasting time trying to optimize the code.

Github Project: github.com/bfs07/Fast-IO-Code-Optimizer

• +11

 » 7 months ago, # |   +1 Thanks, very helpful! 2^1000 without any error, checked by wolfram.Do you have I / O speed test results? Maybe like this
•  » » 7 months ago, # ^ |   +1 He has some here but all of the bad performances seem to be caused by using endl.
•  » » » 7 months ago, # ^ |   +1 Yes, I see, thanksbfs.07, please, do not use endl so often, because every time what you use it output buffer flushes, you can try '\n' instead.
•  » » » » 7 months ago, # ^ | ← Rev. 2 →   0 Thanks for helping me. I will update the test results replacing endl to '\n'. However, the tool still have an improvement of peformance, mainly, on C++11 submissions.
 » 7 months ago, # | ← Rev. 2 →   0 bfs.07, I got compilation error, when I tried to apply script to next code. Can you fix your script for overloads of operator>>?
•  » » 7 months ago, # ^ |   0 Sorry, but as stated on README.md this tool doesn't work with overloads of operator>>. I think I would waste too much time to fix it so I won't. However, it's a open source project and I would be very greatful if you or anyone could help me.
 » 7 months ago, # |   +13 And what is the guarantee that you are not using the code of those who are using your website? ;) just a doubt. Thanks
•  » » 7 months ago, # ^ |   0 Unfortunately, I can't think an easy way to do this the way the tool was implemented. However, I guarantee your data hasn't been used. As an alternative, you can download the project on GitHub and use it offline.