← All posts

The mentality behind competitive programming

CSI KJSSE / 8 Oct 2026

Competitive programming looks like a contest about speed and memory. It is mostly a contest about how you learn. The people who improve fastest are not the ones who have read the most editorials. They are the ones who treat every problem as something they could have invented.

Understanding is not memorising

You can memorise that binary search needs lo < hi and a mid that rounds a certain way. The next problem changes one detail and the memory is useless. If you understand why the loop terminates and what is true at every step, you rebuild the code in a minute, every time.

A concept is learned when it is the first thing you reach for. You see a problem and the idea simply shows up, without a lookup. That feeling comes from effort spent on the problem, not from reading the answer.

Start with the big picture

Before the details, ask one plain question: what is this idea for? Prefix sums answer many range-sum queries without redoing the work. A greedy argument says one local choice is always safe. Hold that one sentence first, then open the details one at a time. If a concept feels overwhelming, you are trying to hold too many pieces at once.

Struggle first, then read

This is the habit that matters most, and the reason the workshop gives you a rabbit hole sheet instead of a solution.

  1. Read the problem until you could explain it to a friend.
  2. Try to solve it, or at least invent part of the idea, for a real stretch of time.
  3. Only when you are truly out of ideas, read a hint, then the editorial.

By then your brain has a gap shaped like the solution, and the editorial fills it. People who skip the struggle read the same editorial and forget it by Friday. Do not fake the struggle. Ten honest minutes of trying beats an hour of staring at a solution.

Every technique you will learn here was invented by someone who was stuck on a problem much like yours. You are capable of the same, even if you do not get there this time.

Care, a little personally

Learning is easier when you care about the answer. If you cannot find passion for the topic, borrow a motive: a contest you want to do well in, a placement round, or plain irritation that a few lines of logic are beating you. Use that irritation. It is a good fuel.

Reinforce, because you will forget

Solving a problem once is not the end. To make an idea stick:

  • Practise it on different problems, and ask why it fits, and where it would not.
  • Explain it to someone from scratch. Wherever you get stuck explaining, you have found a gap.
  • Poke at it. Change one condition and see whether it still works. Try to break it with a strange input. Ask the dumb questions.
  • Revisit it. When an idea fades, try to invent it again from nothing. If you can, it is yours. If you cannot, learn it again. Each pass takes less time.

Forget the talent story

It is tempting to believe some people are just born better at this. It is comfortable, because then there is nothing to fix. But the useful question is never whether you are talented. It is what you are doing that could work better. Compare yourself with others only to steal a method that works.

What this means for the next seven weeks

  • Attend the session, then do the sheet before you open any solution.
  • When you are stuck, write down exactly where you are stuck. That is half of a good question for the Friday discussion.
  • Explain one idea a week to a friend.
  • Slow and thorough on the hard topics. Faster on the easy ones.

You will not get it all in one pass. Nobody does. Keep going back, and keep trying to invent it yourself.