4. How to approach a problem in a competitive programming contest #
Created Thursday 23 April 2020
- This approach is the best for competitive programming, follow it.
Problem
- Paragraphs
- Input Format
- Output Format
- Constraints
- Sample I/O
- Explanation(of I/O) - Optional
The Approach:
- Read the problem and understand it. We may need to read it many many times.
- Analyse the requirements - What we need to do with allowed time limit.
- Think of solution(s) with Time Complexities.
- Choose a solution satisfying the constraint(s).
- Write pseudocode or fix the solution steps.
- Dry Run it once for sample cases.
- Check the I/O format, write code.
- Check if All sample cases are okay. If not, go to Step 4.
- Submit.
- We’ll get the hang of it upon practicing.