Skip to content
Tutorials Center
My learning

Topics

Lesson 61 of 63 ยท Practice and Review

Training Plans and Virtual Contests

Build a weekly training routine: virtual contests, upsolving, finding topic gaps and managing your time during a contest, with small runnable models.

Knowing algorithms is only half of contest skill. The other half is a routine: how often you practice, which problems you pick, how you recover from a bad round and how you spend the two hours of a contest. Two people with the same knowledge can improve at very different speeds depending on this routine.

This lesson gives you a practical training structure that you can adapt to your own free time. It covers the weekly rhythm, how to run virtual contests (past contests played under real conditions), how to upsolve, how to find and fix topic gaps, and how to manage time during a round. If you would like a program that records your attempts and plans your reviews, the training plan tracker project builds one.

The weekly rhythm

A good week mixes four kinds of work. The proportions matter more than the exact hours.

Activity Purpose Typical share
Topic drills Learn or strengthen one technique with 4 to 6 problems 30%
Review of old problems Re-solve problems you failed or needed hints for 15%
Virtual or live contest Practice speed, reading and nerves under a clock 25%
Upsolving Solve what you could not solve in the contest, then study the solutions 30%

Upsolving gets a large share because it is where most of the learning happens. A contest tells you what you cannot do yet; upsolving fixes it.

flowchart LR
  D["Topic drills<br/>(weak topics first)"] --> C["Contest<br/>(live or virtual)"]
  C --> U["Upsolve<br/>every unsolved problem"]
  U --> G["Note the gap<br/>(topic, idea, bug)"]
  G --> D
  U --> R["Review later<br/>with spaced repetition"]
  R --> C

The training loop: each contest produces gaps, which feed the next week's drills and reviews.

Here is a small program that turns a table of topic strengths into a weekly plan for about eight hours. The numbers are examples; replace them with your own success rates, as measured by a tracker.

Python A weekly plan from topic strengths

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The plan puts DP on Monday and math on Wednesday because those are the two weakest topics. Notice what the plan does not do: it does not drill the strongest topic. It feels good to solve problems you already solve easily, but it is the slowest way to improve.

A short, steady routine beats occasional marathons. Five hours spread over five days builds more skill than ten hours on one Sunday, because the brain consolidates what it learned between sessions.

Running a virtual contest

A virtual contest replays a past round with its original problems and time limit. Most judges let you start a virtual participation at any time and then show where you would have placed.

To make a virtual contest useful, follow strict rules:

  1. Choose a round at your level. Pick rounds whose difficulty fits you, so that you can solve about half of the problems. A round that is far too hard teaches nothing about time management.
  2. Do not read any editorial or comments for that round beforehand. Make sure you have not already solved its problems.
  3. Set up like the real thing. Same duration, one screen if you can, no phone, and only the aids that are allowed in real contests. Python's documentation is fine in many rounds; a ready-made solution is not.
  4. Do not pause the clock. If life interrupts, stop the attempt and record it as incomplete instead of pretending.
  5. Write down the result. Note the problems solved, the time of each accepted run, the number of wrong runs and the rank you would have had.

The point is not the score. The point is to practice the skills that never show up when you solve problems at leisure: reading fast, choosing which problem to attack, and keeping calm after a Wrong Answer.

Managing time inside a contest

Most contests reward the number of solved problems first and the total penalty second (the rule set from the scoreboard project). That has a clear consequence: solve the problems you can solve quickest first. Finishing three easy problems in 40 minutes beats spending 100 minutes on one hard problem you may not finish.

A useful routine:

  • First 5 to 10 minutes: read every problem statement (or at least the first few). Rank them by how sure you are of the solution and how fast you can write it.
  • Solve in that order, easiest first. Do not follow the order printed in the problem set; problems are often not sorted by difficulty, and the scoreboard shows how many people solved each, which is a good hint.
  • Timebox. If you have made no progress on a problem after about 20 to 25 minutes, put it aside and move on. Come back with fresh eyes.
  • Limit blind resubmissions. After two wrong runs, stop submitting. Re-read the statement, write a small brute force or hand-test an edge case. Every wrong run costs penalty time in rules like ICPC's 20 minutes.
  • Keep 10 minutes at the end to check that you submitted your latest version and that nothing leftover (debug output!) remains in it.

The effect of ordering is easy to model. Suppose you estimate how long each of five problems will take you, in a 120 minute round. The first problem to solve is not "problem A" but the cheapest one.

Python Why the order of problems matters

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Easiest first solves four problems with a penalty of 167 and matches the best possible result found by trying all 120 orders. Taking the problems in the printed order also solves four, but the penalty is 279, which could cost many places in a big contest where teams are separated by small penalty differences. Starting with the hardest problem solves only two. The model is crude (real estimates are noisy, and wrong runs add penalty), but it shows why ordering by estimated cost is a strong default.

Sorting by estimated time is optimal here because every solved problem is worth the same and each takes a fixed time, so finishing quick ones first leaves the most time and minimizes the sum of finish times. This is the same kind of exchange argument as in greedy algorithms and how to trust them.

Upsolving: the most valuable hour

After a contest, solve every problem you did not solve, in this order:

  1. Try again without help for a limited time (for example 30 to 60 minutes per problem). The contest is over, but the struggle is where understanding grows.
  2. Read a hint, not the solution. Many judges and editorials give a hint section. Use the smallest hint that unblocks you.
  3. Read the editorial only if the hint was not enough, then close it and code the solution from your own understanding.
  4. Get it accepted. An understood but unsubmitted solution is still a gap. Submitting it also records the problem in your history.
  5. Write one line about the lesson. For example "mistook 'at most' for 'exactly'" or "forgot that n = 1 breaks the loop".

Also upsolve problems you did solve if your solution was slow or messy, or if it needed many wrong runs. Compare it with a faster solution and note what you could have seen sooner.

Finding and fixing topic gaps

Keep a simple list of problems that you failed, with a tag for the topic and a tag for the kind of failure:

  • Missing knowledge: you did not know the technique (segment tree, Dijkstra, digit DP). Fix: study the technique, then solve three to five problems that use it.
  • Missing idea: you knew the tools but did not see how to model the problem. Fix: solve more problems of that type and write down the model each time.
  • Implementation bug: the idea was right, the code was wrong. Fix: practice the code type (for example, binary search bounds), keep a tested template and stress-test more.
  • Reading mistake: you misread the statement or constraints. Fix: slow down on reading, restate the problem in your own words before coding (see reading a problem statement).
  • Time pressure or nerves: you knew how and still lost. Fix: more virtual contests, and a fixed routine for the first ten minutes.

Count the tags every month. If half your failures are implementation bugs, studying more algorithms will not help; practicing careful implementation will. This is the cheapest and most overlooked step in training.

Mistakes to avoid

  • Only solving easy problems. Comfortable practice produces no growth. Aim at problems you solve about half the time.
  • Reading editorials too early. Struggling for a bounded time is useful. Give yourself a rule, such as 30 minutes of honest effort before the first hint.
  • Copying code you do not understand. If you could not rewrite it from memory tomorrow, you did not learn it.
  • Comparing yourself to the top of the table. Compare yourself with last month's version of you.
  • Burning out. Rest days are part of the plan. Sleep before a contest matters more than one more problem the night before.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. In a contest ranked by problems solved and then by penalty, what is a strong default order for attacking problems?

    Quick problems first give you solved problems early, leave time for the harder ones and keep the total penalty small.
  2. 2. What is the main rule that makes a virtual contest valuable?

    A virtual contest trains reading, choosing problems and handling pressure. Pausing, peeking or choosing a round that is far too hard destroys that.
  3. 3. After a contest you have three unsolved problems. What is the best first step with each?

    Effort first, then minimal help. Reading a complete solution too early removes most of the learning.
  4. 4. Half of your failed problems are tagged 'implementation bug'. What should you do?

    The ideas are fine; the code is the weak spot. Targeted practice on implementation fixes that, while new algorithms would not.
  5. 5. Why does the weekly plan skip the strongest topic?

    Growth comes from working just beyond your comfort zone. Strong topics are still touched in contests and reviews.

Summary

  • A good week mixes topic drills, review of old problems, a contest and upsolving; upsolving is where most learning happens.
  • Run virtual contests with the real time limit, no pausing and no prior knowledge of the problems.
  • During a round, read all problems first, solve the quickest ones first, timebox stuck problems and limit blind resubmissions.
  • Upsolve in steps: independent attempt, smallest hint, editorial, then your own accepted code and a one-line lesson.
  • Tag each failure (knowledge, idea, implementation, reading, nerves) and fix the most common kind first.
  • Steady practice at the edge of your ability, with rest, beats occasional marathons.

Next: Competitive Programming Interview Questions