Professor____'s blog

By Professor____, history, 13 months ago, In English

The Pain of an Unrated Contest

If you joined Codeforces Round 1048 (Div. 1 + Div. 2), you probably felt the same as many of us: excited, nervous, and ready to climb the ladder. For a while, things looked great—until the announcement dropped:

“The round is unrated due to a missing constraint in problem D/B.”

That one missing line — “Operation 2 can only be applied once” — was enough to ruin fairness. And just like that, the contest was gone.


Community Reactions

Some voices from the blog:

  • “My rank was ~500, I was so happy… then unrated.”
  • “Top 12 and no delta. Hurts a lot.”

Even recap blogs are getting heavy downvotes because people are genuinely upset. It’s rare to see such a strong emotional wave on Codeforces.


Why Unrated?

I get it — it feels unfair. But making the contest rated would have been more unfair.

When a statement is broken, people who solved it under different interpretations can’t be compared. Declaring it unrated hurts, but it keeps long-term trust intact.


What Hurts the Most

It’s not about losing rating — it’s about losing recognition.

Hours of practice, those lucky “aha!” moments, and even best-ever performances… all erased. That’s why many are demotivated right now.


What We Can Take Away

  • Mistakes happen — even on the biggest platforms.
  • Transparency helps — the organizers admitted the error and apologized quickly.
  • We’re stronger than a single contest. The skills are still ours, even if the delta isn’t.

Final Word

This round won’t show up on our rating graphs, but it will remind us why fairness > numbers.

If you did well, remember: your achievement is real. The scoreboard didn’t capture it, but your brain did. And the next round is waiting.

Full text and comments »

  • Vote: I like it
  • -31
  • Vote: I do not like it

By Professor____, history, 13 months ago, In English

Mastering Binary Search with Codeforces Problems (Rating Wise)

Binary Search is one of the most fundamental and powerful techniques in competitive programming. Many beginners only use it to find an element in a sorted array, but in contests, Binary Search is used in much more creative ways.

This post lists problems ordered by rating (800 → 2000) so you can practice progressively.

Easy (800 – 1200)

706B — Interesting Drink — Simple use of binary search with arrays.

1352C — K-th Not Divisible by n — Binary search on the answer.

812C — Sagheer and Nubian Market — Binary search to maximize affordable items.

Medium (1300 – 1600)

371C — Hamburgers — Binary search on the maximum number of burgers.

1181B — Split a Number — Binary search + string handling.

1486C2 — Guessing the Greatest (Hard version) — Interactive + binary-search reasoning.

Hard (1700 – 2000+)

1304C — Air Conditioner — Simulation with binary search bounds.

1157C2 — Increasing Subsequence (Hard) — Greedy + binary search ideas.

148E — Porcelain — Advanced DP + binary-search uses.

1370C — Number Game — Binary search + math reasoning.

Tips to Master Binary Search

  1. Always reframe into a "yes/no" question you can test in O(n) or better.

  2. Practice searching on the answer space (min time, max items, minimal radius, etc.).

  3. Learn lower_bound / upper_bound behaviour and watch out for off-by-one errors.

  4. Binary Search appears everywhere — arrays, functions, probabilities, and geometry. Look for monotonicity!

C++ Binary Search Templates

1) Classic lower_bound / upper_bound style

// find first index i in [l, r) such that check(i) is true
int binary_search_first_true(int l, int r) {
    while (l < r) {
        int mid = l + (r - l) / 2;
        if (check(mid)) r = mid;
        else l = mid + 1;
    }
    return l; // maybe r; verify check(l) before using
}

2) Binary search on answer (example: maximum x satisfying condition)

long long lo = 0, hi = 1e18; // set hi to an upper bound
while (lo <= hi) {
    long long mid = lo + (hi - lo) / 2;
    if (good(mid)) { // good(mid) => mid is feasible
        lo = mid + 1; // try larger
    } else {
        hi = mid - 1; // reduce
    }
}
// hi will hold the maximum feasible value

Happy coding and good luck with your binary search journey!

Feel free to share your solutions and ask questions in the comments below.

Full text and comments »

  • Vote: I like it
  • -19
  • Vote: I do not like it