4. How to approach a problem in a competitive programming contest #

Created Thursday 23 April 2020

Problem

  1. Paragraphs
  2. Input Format
  3. Output Format
  4. Constraints
  5. Sample I/O
  6. Explanation(of I/O) - Optional

The Approach:

  1. Read the problem and understand it. We may need to read it many many times.
  2. Analyse the requirements - What we need to do with allowed time limit.
  3. Think of solution(s) with Time Complexities.
  4. Choose a solution satisfying the constraint(s).
  5. Write pseudocode or fix the solution steps.
  6. Dry Run it once for sample cases.
  7. Check the I/O format, write code.
  8. Check if All sample cases are okay. If not, go to Step 4.
  9. Submit.