How do you tell an approach won't work before implementing it?

Revision en1, by gautrang2474165, 2026-11-19 18:00:30

During contests or upsolving, I keep running into the same issue: as soon as I spot a greedy or DP transition that looks somewhat plausible, I immediately start implementing it without properly verifying the logic. Most of the time, I either get stuck mid-way because the states become too messy, or I submit and get hit with WA on some basic edge cases I completely overlooked. Even worse, sometimes I misjudge the constraints and only realize after writing 100 lines that my complexity won't pass the time limit. Lately, I've been trying to break this habit by writing a quick brute force to stress-test small cases or double-checking the invariants on paper before touching my IDE.

What are some clear signs or "red flags" that tell you an approach is a dead end before you spend too much time implementing it?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English gautrang2474165 2026-11-19 18:00:30 878 Initial revision (published)