Fast input and output
- Stage
- 3
- Module
- M3.10
- Lessons
- 1
In this module
- Use sys.stdin.read() to read large amounts of input quickly.
- Parse input using split() for faster token processing.
- Build output as a list and print it all at once.
- Apply the house skeleton pattern for high-throughput I/O.
Before this module
Lessons
Practice
Try these on the judges. Each link opens the problem on WMOJ or DMOJ.
- 2015 S2Jerseys (opens on DMOJ in a new tab) DMOJ
Process many assignments efficiently; the input size makes fast I/O worth using.
Why DMOJ: A large-input problem where the house skeleton pattern avoids slow input() calls.
- 2025 J4Sunny Days (opens on WMOJ in a new tab) WMOJ
Scan a large run of daily records fast enough to stay inside the time limit.