Never scatter raw getchar calls throughout your logic. Wrap your optimizations in a Scanner class or a dedicated namespace. This makes it easy to swap the "fast" version for a "standard" version during debugging.
: Add a small random delay (50ms–200ms) to the consumption action to make the behavior appear more natural and reduce the risk of being flagged by anti-cheat systems. Community Resources taming io hacks