Hi, Codeforces!
There have already been many posts about coding speed, but my problem is a bit different (although I do struggle with speed too). I often make very basic implementation mistakes.
Before I got into competitive programming, I was developing mobile games and apps. I had written thousands of lines of code and thought implementation was my strong suit. But in practice, contests have shown me the opposite — I keep losing rating purely due to bugs in my code.
For example, in the recent Codeforces Round 1022 (Div. 2), I spent 40 minutes on the second problem, then switched to the third one. I came up with the idea almost immediately after reading the statement, but I only solved it after five wrong submissions and a lot of wasted time. In the end, I earned just about 600 out of 1500 points. In all those submissions, the logic was nearly the same — the bugs were purely in the implementation.
This isn’t the first time I’ve lost rating because of clumsy coding.
What would you recommend? How can I practice writing code more carefully? Are there any resources or problem sets where the main challenge is implementation rather than thinking?
Can speedrun of an already solved problem help?








Auto comment: topic has been translated by HCCoder (original revision, translated revision, compare)
I struggle with the same issue, the advice I was given was to try and solve more CSES problems and try to "speedrun" them. Another suggestion, if you encounter an issue like this during contest, is to try to create random test cases to try to find edge cases in your code; using a tool like CPH judge makes this much easier.
Thanks for your attention!
same shit, after many times making the same mistake, i try to prove my code or give some kind of counter-tests
hope that i helped you:)
Thank you for attention.
I'm curious. So you mean you have an easier time debugging actual software than CP code? Why is that? Is it because software code is usually more straightforward than CP code?
imo it depends on who wrote the software, but usually it is
Yes. For example, in cp if you write code that reaches the hundredth test and fails, then it is still wrong. But in the code of software there is no such thing, if there are bugs, then someone will write about it, then I will fix it.
speedrunning already solved problems can help reinforce clean bug free implementation.Also try solving implementation tagged problems on Codeforces to build muscle memory and precision.Overtime this will reduce careless mistakes in contests.
Implementation in CP can't really be taught, you just acquire it as you go. Some tips that I can probably give you is:
implementationtags, or solved problems that you remembered that you struggled with implementation. Problems from Codeforces are usually not very implementation-based, so you may have to seek another source (ICPC, OI contests, etc)