cp_tricks 0.1.0

Tricks for competitive programming. Do not use this crate.
Documentation
  • Coverage
  • 54.55%
    6 out of 11 items documented4 out of 10 items with examples
  • Size
  • Source code size: 7.42 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.64 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • trickster

Tricks for Competitive programming

IO

  • Use Scanner directly and parse input step by step
  • Use input! macro for any arbitrary inputs (Codeforces, Codechef requires this)
  • Or, use Scanner or UnsafeScanner for parsing input on demand

dbg! macro

  • dbg! is so handy, you can place it anywhere in the code, around a variable or even an expression, it outputs the value of expression to stderr. Great for debugging
  • dbg!, when in doubt, pass the reference