Skip to content

natedemoss/cf-recommend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cf-recommend

Know exactly what to practice next on Codeforces. A fast, local-first CLI that analyzes your submission history and recommends problems tailored to your weak topics.

npm version license platforms

npm install -g cf-recommend

Features

  • Weak-topic targeting — finds tags you struggle with
  • Adaptive difficulty — recommendations based on your solving level
  • Explains itself — every suggestion comes with a reason
  • Local-first — cached in SQLite, instant, works offline
  • Zero-friction — prebuilt binary via npm

Demo

$ cf analyze
  tourist  —  616 problems solved across 683 attempted
  Adaptive solving level: ~1650

  Problem-Solving Breakdown  (success rate · solved/attempted)
    Math                  92%   291/315
    Greedy                90%   300/334
    DP                    84%   75/89
    Binary Search         82%   54/66
    Graphs                69%   11/16
    Divide And Conquer    63%   5/8     (weak)

$ cf next --weak-topics-only --count 1
  1. 1167B  rating 1400  ·  Divide And Conquer [weak area]
     Lost Numbers
     Why: You're only 63% proficient in Divide And Conquer.
     For you: Medium  (feels like ~1475)   Est. 25-40 min
     https://codeforces.com/problemset/problem/1167/B

Quick Start

cf login <your-handle>     # download & cache your history
cf analyze                 # per-topic breakdown
cf next                    # get recommendations
cf weak-topics             # your weakest topics
cf progress                # recent activity & streak

Commands

Command Description
cf login <handle> Verify handle & download history
cf sync Re-fetch submissions & problem set
cf analyze Per-topic success-rate breakdown
cf next [options] Recommend problems to solve
cf weak-topics Weakest topics with insights
cf progress Recent activity & improvements
cf config [key value] View or change settings

next Command Options

Flag Meaning
--count N Problems to show (default 10)
--topic NAME Filter by topic (dp, greedy, graphs, etc.)
--difficulty A-B Rating range (e.g., 1400-1600)
--max-rating N Cap problem rating at N
--weak-topics-only Only problems from weak topics

Topic names are flexible: binsearch, binary-search, and binary search all work.

Examples

cf next --weak-topics-only --count 10
cf next --topic dp --difficulty 1400-1600 --count 5
cf config max-rating 1700

More examples

The outputs below were generated after cf login SecondThread. When a problem has several tags, the output highlights the tag that most influenced the recommendation, even if a different --topic filter also matched it.

Find DP problems in a medium rating band:

cf next --topic dp --difficulty 2000-2300 --count 1
Top 1 problems for SecondThread  (solving level ~2256)  [max 2300]

1. 1721E  rating 2200  ·  String Suffix Structures [weak area]
   Prefix Function Queries
   Why: You're only 63% proficient in String Suffix Structures — focused practice on a weak area.
   For you: Medium  (feels like ~2275)   Est. 25-40 min
   https://codeforces.com/problemset/problem/1721/E

Focus a specific weak area with a rating cap:

cf next --topic meet-in-the-middle --max-rating 2200 --count 1
Top 1 problems for SecondThread  (solving level ~2256)  [max 2200]

1. 1006F  rating 2100  ·  Meet-In-The-Middle [weak area]
   Xor-Paths
   Why: You're only 60% proficient in Meet-In-The-Middle — focused practice on a weak area.
   For you: Medium  (feels like ~2180)   Est. 25-40 min
   https://codeforces.com/problemset/problem/1006/F

Use a shorthand topic name:

cf next --topic binsearch --count 1
Top 1 problems for SecondThread  (solving level ~2256)

1. 1537E2  rating 2200  ·  String Suffix Structures [weak area]
   Erase and Extend (Hard Version)
   Why: You're only 63% proficient in String Suffix Structures — focused practice on a weak area.
   For you: Medium  (feels like ~2275)   Est. 25-40 min
   https://codeforces.com/problemset/problem/1537/E2

Save a default max rating for future recommendations:

cf config max-rating 1900
cf next --topic graphs --count 1
Set max-rating to 1900  — `cf next` will only suggest problems at or below this rating.

Top 1 problems for SecondThread  (solving level ~2256)  [max 1900]

1. 20C  rating 1900  ·  Shortest Paths
   Dijkstra?
   Why: Solid Shortest Paths problem near your level.
   For you: Easy  (feels like ~1928)   Est. 15-25 min
   https://codeforces.com/problemset/problem/20/C

How It Works

Adaptive Solving Level: Based on the 80th percentile of your solved ratings (blended 50/50 with your Codeforces rating). Falls back to your CF rating or 1400 for new accounts.

Proficiency: Aggregated per-problem (retries don't distort rates). A topic needs ≥3 attempted problems to be reliable; below 70% is weak.

Recommendation Score: Each unsolved problem receives a score between 0 and 1:

0.40 × topic_weakness + 0.30 × rating_fit + 0.20 × popularity + 0.10 × variety

Per-User Difficulty: Weak topics add up to +200 to a problem's effective rating for you.

Data & Caching

  • Data from public Codeforces API with automatic rate-limit retry
  • Cached in SQLite: ~/.cf-recommend/ (Unix) or %LOCALAPPDATA%\cf-recommend\ (Windows)
  • analyze, next, weak-topics, progress work offline; run cf sync to refresh

Contributing & Roadmap

See CONTRIBUTING.md for dev setup. Good first areas: smarter ranking, new filters, platform testing.

Planned: Friend comparison · Division-aware filtering · Learning paths · Export functionality

License

MIT © natedemoss

About

Codeforces CLI tool

Resources

License

Contributing

Stars

51 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors