Setting up a competitive programming workspace takes an afternoon and pays you back for years. The goal is narrow: make it quick to write a solution, run it against sample input, and submit without hunting for files or remembering compiler flags. You do not need an expensive machine or a wall of monitors. You need a folder structure, one editor you know well, and a test loop you trust.
Start with one folder and one template
Keep every attempt in a single folder, named after the contest date and problem letter, such as 0512-c.cpp. That naming makes it trivial to find yesterday’s solution when a similar idea appears again. Add a template file containing the includes you always use, a fast input reader if you like one, and an empty main function. Copy it at the start of a contest instead of typing boilerplate while the clock runs.
Inside the folder, keep three subfolders: solutions, testcases, and notes. Name test inputs to match the solution, so 0512-c.cpp expects 0512-c.in and 0512-c.out. Then a single command can compile, run, and compare.
Choose an editor and learn five shortcuts
Any editor works. The one you already type in is usually the fastest choice, because contest time is spent thinking rather than configuring. Spend one evening on the shortcuts that genuinely save keystrokes:
- Duplicate line, for copying a loop skeleton.
- Comment and uncomment a block, for switching debug prints on and off.
- Jump to matching bracket, which catches missing braces before the compiler does.
- Rename symbol, useful when a variable name stops making sense halfway through.
- Open file by name, for moving between your template and the current solution.
Leave aggressive autocomplete off unless you have practised with it. A tool that surprises you mid-contest costs more time than it saves.
Build a test loop you trust
The workspace’s real job is answering one question quickly: does this code produce the right output on the samples? Set up a run command that compiles with warnings enabled, feeds the sample input, and shows your output beside the expected output. Warnings are free information; treat them as errors during practice so they never reach a submission.
Save a few edge cases of your own: the smallest possible input, a case with repeated values, a case sitting at the maximum size. Keeping them next to the problem file means the next similar problem starts with a head start.
Keep references in sight and clutter out
A second monitor is pleasant, but a split window is enough. Maintain a short plain-text note of syntax you always forget: sorting with a custom comparator, reading a whole line after a number, initialising a two-dimensional vector. Fifteen lines of personal reminders beat a long reference you cannot search quickly.
At the end of each session, delete throwaway files and move anything worth keeping into notes. A workspace that accumulates half-finished attempts becomes slow to scan, and scanning is exactly what you do when time is short.
Frequently asked
Do I need a fast laptop or a special keyboard?
No. Compile times of a couple of seconds are fine for beginner problems. Comfort matters more than speed, and a keyboard you type accurately on is worth more than one with fancy switches.
Should I practise in the language I will compete in?
Yes, at least for the first few months. Switching languages mid-practice breaks the muscle memory that makes your template and shortcuts useful.
Set the workspace up once, then leave it alone. The best setup is the one you stop noticing, because your attention belongs on the problem rather than on your tools.