1 unstable release
0.1.0 | Jun 28, 2021 |
---|
#3 in #not
8KB
147 lines
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
orUnsafeScanner
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 debuggingdbg!
, when in doubt, pass the reference
lib.rs
:
Tricks for competitive programming
Most used ones are
- Macro [input!] for input parsing all at a time
- [Scanner]/[UnsafeScanner] for parsing on demand