CP trainer — new tool for training

Revision en40, by michao, 2025-10-03 17:05:29

Hello,
I created a project for training and analyzing your performance during contests: cp-trainer.com. I believe it has some unique features not existing in competitive platforms and can provide as a more sensible tool for training, especially for more experienced users who have participated already in a bunch of contests. Below I will briefly discuss its functionalities:

Problem recommender

In this section, we will discuss the heuristics used for problem recommender. First we need to introduce briefly a couple of metrics:

  • get_dict_accuracy — Dictionary of form (tag : average number of submissions to accept problem with this tag during contest)
  • ratings_average_time_diffs — Dictionary of form (rating : average time in seconds to solve the problem with this rating during contest)
  • tags_average_time_diffs — Dictionary of form (rating : average time in seconds to solve the problem with this tag during contest)
  • problem_freshness — calculates the freshness of a problem by taking the contest in which it occurred (values normalized between 0,5 and 1)
  • compute_tag_rating — Dictionary of form (tag : predicted user rating for this specific tag)

Now it is time to describe the heuristics:

  1. Let $$$r$$$ denote the rating of a problem, and let $$$\mathcal{T}$$$ denote the set of tags of that problem.

  2. Let

$$$ A := \texttt{tags_average_time_diffs},\qquad Q := \texttt{get_dict_accuracy} $$$

be the dictionaries defined in the metrics.

  1. Let
$$$ T := \mathcal{T}\cap\operatorname{dom}(A),\qquad S := \mathcal{T}\cap\operatorname{dom}(Q). $$$
  1. Let
$$$ m_T := \frac{1}{|T|}\sum_{t\in T} A[t]. $$$

For dictionary $$$A$$$ define bounds for normalization as:

$$$ (\ell_A,u_A) := \big(\min_{x\in\operatorname{dom}(A)} A[x],\ \max_{x\in\operatorname{dom}(A)} A[x]\big). $$$
  1. Let
$$$ m_Q := \frac{1}{|S|}\sum_{t\in S} Q[t], $$$

and for $$$Q$$$ define normalization bounds

$$$ (\ell_Q,u_Q) := \big(\min_{x\in\operatorname{dom}(Q)} Q[x],\ \max_{x\in\operatorname{dom}(Q)} Q[x]\big). $$$
  1. Define a normalization function (for $$$a\neq b$$$ and $$$x\in[a,b]$$$):
$$$ \mathrm{Normalize}(a,b,x) := \frac{x-a}{\,b-a\,}. $$$
  1. Define
$$$ h_2 := \mathrm{Normalize}(\ell_A,u_A,m_T), \quad h_3 := \mathrm{Normalize}(\ell_Q,u_Q,m_Q). $$$

Intuitively we want to recommend problems that are weaknesses for the user: $$$h_2$$$ and $$$h_3$$$ grow larger when the user typically takes more time on problems with those tags or needs more attempts to solve them.

  1. Let $$$c$$$ be the contest id. Define $$$\mathrm{fresh}(c)$$$ as the metric problem_freshness.

  2. Define

$$$ \kappa(c) := \begin{cases} 0.4, & \text{if the contest is Div.4}, \\[4pt] 0.7, & \text{if the contest is Div.3}, \\[4pt] 1, & \text{otherwise.} \end{cases} $$$
We want Div.3 and Div.4 problems to be treated as less valuable.
  1. Let $$$U\sim\mathrm{Uniform}(0.3,0.4)$$$ be a random component introduced to diversify recommended problems.

  2. The final heuristic $$$H(r)$$$ is

$$$ H(r) = \kappa(c)\Big( h_1 + h_2 + h_3 + U + 1.5\cdot\mathrm{fresh}(c)\Big). $$$
(We add $$$1.5\cdot\mathrm{fresh}(c)$$$ rather than multiplying by $$$\mathrm{fresh}(c)$$$ to avoid giving very fresh contests an overwhelming advantage.)

Contest training picker

In this module user can choose one of the 4 contest modes depending on what he wants to train:

  • Speed — The contest consists of 5 easy-medium problems. The problems' ratings are based on expected time to solve them i.e. the system expects the user to solve them in about 2000 seconds. The tags are chosen based on the weaknesses of the user (i.e. the tags which take him more time on average). The idea is that the contestant during such contests will practice solving faster the easy-medium problems, that will allow him to have more time on the harder ones.
  • Hard problems — The contest consists of 3 problems from the list of 10 in the problem recommender.
  • Weaknesses — The contest consists of 3 problems, all from topics, that user is weak at. The rough idea was to take the random 3 out of 5 tags with lowest value from the metrics compute_tag_rating and for each tag take the problem with rating as close as predicted rating on that tag + 200. In practice some comparator was used, which also takes into the account the freshness of the contest the problem comes from. (We rather want to solve the problems from fresher contests, since problems have changed a lot in past years).
  • Upsolve — The contest consists of 3 problems, that contestant didn't solve during past contests (he either had rejected submissions on them or they were the first problems during the contest that he didn't get accepted) with the best quality according to problem recommender.

Note : The duration of the contest (never greater than 5 hours) is calculated automatically based on the expected time to solve the problems (user should solve some problems to not get discouraged, but of course not all). The contestant can limit this time by setting the max duration (he doesn't have to), however it is not very recommended, because the system will just discard some problems from the problemset to adjust the time.

User stats

In this mode there are presented plots that show mainly different statistics about user's performance during the contests. Below we can see the sample statistic showing my average time to solve a problem during contest with specific tag. One can deduce that I have the most difficulties with problems including probabilities and schedules. What's important to mention is that it would be best to include this based on rating, however the data is too small so we rely on the fact that it will average out across all ratings. Unfortunately with tags like flows where problems don't have probably low ratings, this won't be consistent, however with the most popular tags this should show good trends.



The included interesting statistics are (the time unit is measured in seconds):

  • Average time to solve a problem by rating
  • Average time to solve a problem by tag
  • Average nr of attemps to solve a problem with specific tag — This is especially useful when we want to check on which problems we have difficulties with implementation/handling edge cases.
  • User rating on a tag — For each tag we calculate the rating of a user on this type of problems based on the performance during contests.
  • Average rating of solved/unsolved problems — This shows what is the average highest solved problem during contests and the average lowest rating of the problem that user did not solve. It is useful e.g. when you want to check the rating of the average problem on which you block during contests and helps you to pick problems with appropriate rating during practice.
  • Average rating change when doing problems in order/not in order — This calculates the average rating change when you do either the problems in order or not (e.g. you skip some problems etc.).

Compare yourself against the others

The idea for this section was to analyze for the user, how much he is worse than the average contestant with some specific rank. It was realized by taking statistics for 40 average random users across that specific rank , who participated in >=50 contests and were registered min 3 years ago. (that should approximate well the random user with some rank.)



We can see in the picture above the sample statistic of me compared with the average grandmaster, telling what is the average time difference (in seconds) of solving problem with some specifing rating. As we can see, I am slower on the most of the ratings, especially in the hardest ones.
The included statistics are almost the same like in the user stats section, here we just take difference between the contestant and average user of some rank.
Note: The green bars mean there is contestant's advantage, red otherwise.

Summary

The goal was to create the tool which will analyze user's performance during live contests and then based on that recommends adequate problems for training. Most apps focus on the stats of the user also during practice, which in my opinion don't provide the best insight e.g. because outside the contest you have unlimited time and also you can look at editorial.

If you find any bugs, please let me know and I will try to fix them as soon as possible. Any constructive criticism is also appreciated. Thanks for checking out the platform.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en56 English michao 2025-10-04 01:22:27 0 (published)
en55 English michao 2025-10-04 01:10:40 21
en54 English michao 2025-10-04 01:07:54 4
en53 English michao 2025-10-04 01:04:43 2
en52 English michao 2025-10-04 01:03:08 8
en51 English michao 2025-10-04 00:59:27 10
en50 English michao 2025-10-04 00:58:08 99
en49 English michao 2025-10-04 00:42:19 636
en48 English michao 2025-10-04 00:25:18 57
en47 English michao 2025-10-04 00:23:55 183
en46 English michao 2025-10-03 18:57:59 1584 Reverted to en42
en45 English michao 2025-10-03 18:57:35 1811
en44 English michao 2025-10-03 18:53:58 1097
en43 English michao 2025-10-03 18:51:46 1070
en42 English michao 2025-10-03 18:47:01 1370
en41 English michao 2025-10-03 18:17:00 1645
en40 English michao 2025-10-03 17:05:29 5
en39 English michao 2025-10-03 17:04:58 617
en38 English michao 2025-10-03 16:05:11 2766
en37 English michao 2025-10-03 16:04:27 16
en36 English michao 2025-10-03 16:03:19 34
en35 English michao 2025-10-03 15:58:09 635
en34 English michao 2025-10-03 15:46:18 298
en33 English michao 2025-10-03 01:20:53 19
en32 English michao 2025-10-03 01:17:03 9 Tiny change: ' each tag there is calculated the ratin' -> ' each tag we calculate the ratin'
en31 English michao 2025-10-03 01:16:10 10 Tiny change: '5c.png">\n\n<br/>\n\nThe incl' -> '5c.png">\n<br/> <br/>\nThe incl'
en30 English michao 2025-10-03 01:15:32 9
en29 English michao 2025-10-03 01:13:31 3 Tiny change: 'depending what he w' -> 'depending on what he w'
en28 English michao 2025-10-03 01:13:11 2 Tiny change: 'ipated in bunch of ' -> 'ipated in a bunch of '
en27 English michao 2025-10-03 01:01:14 5 Tiny change: '>\n\n<br/><br/>\n\nT' -> '>\n\n<br/>\n\nT'
en26 English michao 2025-10-03 01:00:52 193
en25 English michao 2025-10-03 00:57:59 2370
en24 English michao 2025-10-03 00:43:01 248
en23 English michao 2025-10-03 00:27:15 117
en22 English michao 2025-10-02 23:44:46 52
en21 English michao 2025-10-02 23:43:36 6 Tiny change: 'n that tag. In pract' -> 'n that tag + 200. In pract'
en20 English michao 2025-10-02 23:42:17 1 Tiny change: 'ms' rating's are base' -> 'ms' ratings are base'
en19 English michao 2025-10-02 23:41:53 428
en18 English michao 2025-10-02 23:30:16 1616
en17 English michao 2025-10-02 22:57:57 31
en16 English michao 2025-10-02 22:54:44 9
en15 English michao 2025-10-02 22:54:10 15
en14 English michao 2025-10-02 22:52:14 2
en13 English michao 2025-10-02 22:51:28 10
en12 English michao 2025-10-02 22:49:45 93
en11 English michao 2025-10-02 22:47:34 28
en10 English michao 2025-10-02 22:38:12 1154
en9 English michao 2025-09-29 00:50:06 9
en8 English michao 2025-09-29 00:49:33 377
en7 English michao 2025-09-29 00:36:46 74
en6 English michao 2025-09-29 00:35:11 137
en5 English michao 2025-09-28 13:19:36 729
en4 English michao 2025-09-28 13:04:51 286
en3 English michao 2025-09-28 13:01:03 19 Tiny change: 'g contests. [Website](https://' -> 'g contests: [cp-trainer.com](https://'
en2 English michao 2025-09-28 13:00:36 4 Tiny change: '). <br/>\n\nI believ' -> '). <br/>\nI believ'
en1 English michao 2025-09-28 12:58:14 299 Initial revision (saved to drafts)