Powered by Starship v1.3
Bad CF Practices, part 2
Jul 19 2024
11:43 AM

Today I was working through another simulated CCC contest and noticed how codeforces/speedforces has shaped my problem triage process - as CF doesn't award partials, my brain has gotten used to this decision tree:

  • read problem
    • approach - categorize into dp/greed/math
    • constraints - what complexity will pass?
    • consider answer format

  • spam ideas
    • possibility of implementation: can I write this up + debug in reasonable time
    • validity: does this hinge on an assumed greedy to hold?
    • optional: write up bruteforce to find hidden observations

  • can I solve this?
    • yes: ok, write up implementation as fast as possible
    • no: move on to next question

This is mostly fine for CF - but overly prioritizes time. In contests like USACO / CCC, time to solve doesn't strictly matter, and unlike CF, there are no penalties for incorrect submission. Also, this decision tree at no step considers partials.

Specifically, I was bashing out some problem using a graph traversal pass and then a query processor with a segtree - all of which were pretty complex and prone to error. A better approach would be to start with the traversal alone, and use a slow n^2 to process queries, and this would've passed at least the first few subtasks, but codeforces brain instead jumped for the potentially-full-points solution that came also with high risk / debug cost.

Seeing that the majority of contests award points for partials / subtasks, as well as sometimes different timing constraints, adopting CF speedforces everywhere isn't good. :P

tags: programming codeforces