diff --git a/posts/algorithms/cp-log.html b/posts/algorithms/cp-log.html index f3051da..80c94f5 100644 --- a/posts/algorithms/cp-log.html +++ b/posts/algorithms/cp-log.html @@ -35,6 +35,85 @@

Competitive Programming Log

+

+ 891 (div. 3)—{6,7}/5/2025 +

+
+

+ Solved partially on the plane and at home. Best round in terms of + acceptance rate. After bombing another codeforces contest & more + CSES work, it's clear that my biggest weakness is + algorithmic correctness and certainty. To remedy: +

+ +
    +
  1. + A: ironically, although I got AC in ~1 minute, this is exactly + where I go wrong. I did not check the actual correctness of my + parity checks but submitted anyway. +
  2. +
  3. + B: AC once again but implementation is still a weakness. + In this case, it was due to a lack of problem understanding, + i.e. rounding up sets all right digits to 0, but carries can + still affect the number after that. +
  4. +
  5. + C: skipped and came back later. The idea of sorting came up but + I was overwhelmed. My end solution was a bit overcomplicated but + still logically sound. I'm getting better at making + observations, in this case explicitly identifying the fact that + the largest element must have one more element greater than or + equal to itself, permitting you to build the answer in reverse + order. Did not prove the correctness of this. +
  6. +
  7. + D: skipped and came back later. Given the large amount of + vertices I did a good job of rephrasing the data (thanks + George Pólya) and proving the correctness with + transitivity/contradiction. Initial solution + complex—ponder implementation before going at it. +
  8. +
  9. + E: took me a while (I believe) because I was on a plane without + a notebook and visualizing was hard. Good mathematical + formulation, but initially returned the answer in wrong order. + Relied on the test cases to save me—ensure you're + solving the actual problem + (in this case, returning the queries in the right order). +
  10. +
  11. + F: Quadratic equation flew over my head. I was unsure but + should've just played with the numbers—if you plug them + in, you derive the quadratic equation relevant to the problem. I + then (maybe) could've gotten an answer. Instead, I was + intimidated because I thought I needed some fancy + DSA/dp/two-pointers/two-sum thing. Just have to build more + intuition. Also, totally did not know how to count number of + distinct pairs \(i, j\) with \(i\lt j\) for two elements. I + missed the case when the elements are equal and, yes, seriously + forgot it is just the product (I do not want to talk about it + but thanks Deepseek). + Overflow, again. rly dude? +
  12. +
  13. F: doing this later, got the core insight of the minimal weight edge path. Once again, for surveying path
  14. +
+

cses (range queries, sorting and searching)—1/3/2025