Блог пользователя Ashutoshthelearner

Автор Ashutoshthelearner, 5 часов назад, По-английски

Hey everyone!

I've been doing competitive programming for quite some time, and one problem I've repeatedly faced is:

After solving hundreds of problems, what should I actually practice next?

Codeforces gives us a huge amount of information — rating history, submissions, problem tags, verdicts, etc. But turning all of that into something actionable is surprisingly difficult.

So I built Codeforces Analytics to try to solve this.

LIVE DEMO: Codeforces Analytics

GITHUB: Source Code

What does it do? 1. Rating Analysis The project fetches your Codeforces rating history and visualizes your progression across contests.

You can see: - Current rating - Maximum rating - Current rank - Maximum rank - Rating progression over contests This makes it easier to understand your progress instead of looking only at your current rating. 2. Problem-Solving Analytics The system analyzes your submissions and calculates: - Problems solved - Difficulty distribution - Tag distribution - Success rate by topic - Weak topics For example, your profile might look like:

DP → 22% success Graphs → 28% Geometry → 31% Greedy → 65% Binary Search → 72%

Instead of simply saying "you solved 200 DP problems", the system tries to answer:

Which topics are you actually struggling with? 3. Personalized Problem Recommendations This is probably the most interesting part of the project.

The recommendation system is currently rule-based rather than ML-based.

I deliberately chose this approach because I wanted every recommendation to be explainable.

The basic pipeline is:

Codeforces submissions ↓ Analyze solved problems ↓ Calculate success rate by tag ↓ Identify weak topics ↓ Find suitable unsolved problems ↓ Score problems ↓ Return top recommendations

How are problems scored?

Each candidate problem receives a score based on three things. 1. Weak-topic coverage — 50% If a problem matches multiple topics that you're weak at, it gets a higher score.

For example:

Your weak topics: DP Graphs Geometry Trees

Problem tags: DP Graphs Trees Math

This problem matches 3 of your weak topics, so it gets a strong coverage score. 2. Weakness severity — 30% Not every weak topic is equally weak.

For example:

DP → 20% success Graphs → 40% Greedy → 70%

DP receives a higher priority because the success rate is much lower.

The idea is:

Don't just practice the topics you have solved the most problems in. Practice the topics where you're actually struggling. 3. Difficulty — 20% The recommender normally looks for problems around:

your rating + 100 to your rating + 300

For example, if your rating is 1200, the normal target range becomes 1300–1500.

This gives a reasonable difficulty progression.

High-rated users

I also encountered an interesting edge case while testing.

Suppose someone has a rating of 3442.

The normal recommendation range would be:

3542–3742

But the highest-rated problems available in our database are currently rated 3500.

So the recommender would originally return:

"No suitable unsolved problems found."

That's obviously not useful.

I added a fallback:

No problems in normal target range ↓ Find highest-rated available problems ↓ Recommend from that pool

For example, a high-rated user can now receive 3500-rated recommendations instead of getting an empty recommendation list.

The explanation also tells the user that these are among the highest-rated available problems, rather than incorrectly claiming that they are inside the normal target range.

Why not use Machine Learning?

I considered it, but for the current version I think a rule-based approach is better.

A recommendation such as:

"Recommended because this problem matches 5 of your weak topics and is among the highest-rated available problems for your current rating."

is much easier to understand and debug than:

"The model gave this problem a probability of 0.82."

I may experiment with ML later, but I wanted the first version to have a transparent recommendation engine.

Tech Stack - Python - FastAPI - PostgreSQL - SQLAlchemy - Alembic - Docker / Docker Compose - pytest - Jinja2 - Chart.js The application is deployed publicly so anyone can try it.

Testing

I also wanted to treat this as an actual backend project rather than just a demo.

The current test suite has:

44 tests passing

There are regression tests for the recommendation system, caching, analytics, and high-rated users.

For example, there is a test specifically checking that a user with rating 3442 doesn't end up with an empty candidate set simply because there are no problems rated 3542–3742.

Try it with your own handle

LIVE DEMO: Codeforce Analytics

Enter your Codeforces handle and check: - Is your rating analysis accurate? - Are the identified weak topics actually your weak topics? - Are the recommended problems useful? - Are there problems you think should have been recommended? - What other analytics would you like to see? I'd especially appreciate feedback from people with different rating levels, because recommendation quality can be quite different for a 900-rated user versus a 2500+ rated user.

What's next?

There are several things I'd like to add in the future: 1. Practice Plans Instead of simply showing 10 problems, generate something like:

Day 1 → 1300 DP Day 2 → 1300 Graphs Day 3 → 1400 DP Day 4 → 1400 Binary Search

and gradually increase the difficulty. 2. Better Difficulty Progression Instead of using a fixed +100 to +300 range, the difficulty could adapt based on recent contest performance and solving behavior. 3. More Detailed Contest Analysis For example: - Which contests caused rating losses? - Which problem letters do you usually fail on? - How quickly do you solve A/B/C/D? - Where do you tend to get stuck? - Which topics are responsible for most failed submissions? 4. More Advanced Recommendations I may eventually experiment with ML-based recommendations once there is enough useful data, while keeping the recommendations explainable.

Final Thoughts

The main idea behind the project is simple:

Your Codeforces profile contains a lot of information about how you practice. Why not turn that information into a concrete practice plan?

The project is still evolving, so I'd really appreciate feedback from people who actually use Codeforces regularly.

If you try it, please let me know whether the recommendations make sense for your profile.

LIVE DEMO: Codeforces Analytics

GITHUB: Source Code Thanks for reading, and happy solving!

  • Проголосовать: нравится
  • -5
  • Проголосовать: не нравится