From 77807707daa7bc3b01c7891773a6045e02530b61 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 27 Mar 2025 16:10:44 -0400 Subject: [PATCH] feat(cf/895): blog --- posts/algorithms/cp-log.html | 69 ++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/posts/algorithms/cp-log.html b/posts/algorithms/cp-log.html index 59f3a7a..0527f08 100644 --- a/posts/algorithms/cp-log.html +++ b/posts/algorithms/cp-log.html @@ -35,6 +35,75 @@

Competitive Programming Log

+

+ 895 (div. 3)—26/3/2025 +

+
+

Decent.

+
    +
  • + A: math intuition building. Jumped to assuming the problem + statement but it was much simpler. + Answer the problem only. +
  • +
  • + B: textbook simple problem that I struggle to mathematically + quantify being distracted by many components. In retrospect, I + should interpret the problem simply like: +
    + Each trap has a known time I must return by. The answer is + therefore the minimum of these. +
    + I also just plug in \(ceil\) and \(floor\) until I find the + right answer (I'm not lying). Instead, note that for + \(s,k\in\mathbb{Z}\), + \[\frac{s}{2}>k\leftrightarrow\lfloor\frac{s-1}{2}\rfloor\geq + k\]. This simply "edges out" the fractional term to line up + cleanly with the divisor. +
  • +
  • C: cooked. Practice number theory.
  • +
  • + D: took me a while because I was distracted with the moving + parts. Specifically, I forgot that I could choose the + permutation and that the question was merely asking to pick the + largest/smallest numbers on \(x\)/\(y\) slots respectively. End + solution was expressive and elegant. + Express the question and reframe the constraints in simple + but accurate terms. +
  • +
  • + E: Black-boxed a lazy segment tree (with the help of AI, I must + admit—I need to make a template). +
    + Everything I did here was wrong and this problem showed an + embarrassingly fundamental flaw in my practice strategy. +
    + Namely, I should divide up practice time into: +
      +
    1. Contests, emphasizing speed and implementation
    2. +
    3. + Single problems, emphasizing specific learning objectives +
    4. +
    +
  • + In this problem, I immediately saw the application of the lazy + segment tree but decided to hold off on it, failing to find the + simpler prefix-XOR solution. Therefore, I not only wasted my time, + but also cemented in unrealistic practice (I would never do this + in a real contest) and worsened my virtual contest performance. As + for the prefix-XOR solution, focusing on just one/zero + corresponding elements and + walking through small examples + (i.e. "what happens when \(l=r\)?") would've help me pick up the + pattern. +
+

1013 (div. 3)