How do I improve my logic?

I seem to do well in the writing of code but just can’t seem to wrap my head around the logic involved with coming up with an algorithm during the USACO Bronze contests. How do I improve my logic quickly as I am very busy.

Well, there isn’t a lot of time left before the January Contest, so if being “very busy” is an issue for you, there really isn’t much you can do at this point. All I can say is, do more problems to help build your intuition.

I think my original post could use some explaining, I’m able to do Usaco for around 1 hr a day and I’m decent at writing code but struggle to come up with a logical way to solve the problem. What could I do to improve my implementation skills?

bump, would like to know some secrets too. been practicing past bronze contests for a year now and I don’t think I’m getting any better, if my results for the December contest is the gauge.

1 Like

Make sure to solve problems without looking at the editorial (even if it means sacrificing the quantity of problems you solve).

Use the USACO guide because the authors of the USACO guide are literally the problem writers for USACO (for most of them I think) and solve problems from various coding websites such as CF, Leetcode, Code chef, etc. Don’t give up on a problem if you get stuck, try to understand it even if you have to look at the editorial.

1 Like

But sometimes it is good to read the editorial, you can still learn.

1 Like

For improving problem-solving skills:
Do a lot of problems. What’s often forgotten is to find the motivation for every detail that you missed when attempting (e.g. I should’ve done more observations, I shouldn’t have focused on only one approach for too long, I should’ve tried to think of a nice way to take advantage of the conditions given, etc.)

For improving implementation skills:
I usually code in memory as much as possible. This is to prevent typing things that you’ll realize eventually are not needed or a better solution exists.

If the solution is really (All bronze problems can be completely solved in the head) long (or if you just want to be quicker) then there are other strategies like typing the code in phases, pseudocode, etc.

Often, there is a trade-off between this strategy and speed; writing the code in phases is usually faster than thinking about it 100% then writing it all at once. However, writing the code in phases can be more error-prone.

Code in memory? What do you mean by that?