How to read problem statements in Competitive Programming :
We all know how to read, we have our whooping 2 month of experience! Oh, my sweet summer child, my experiments show that many people with kinda cool achievements like medals on ROI don't know how to read statements. But don't worry, I'll teach you. Well, probably you won't understand anything, because you didn't try to understand anything in your life, you expect all hard work to be done for you by someone else. Let's start!
Basic rules
The result of reading the statement is usually pure math model. If story helps to build correct understanding, you can keep it, but still try to discard as many unnecessary details as possible.
Imagine you want to tell the problem to someone else. What parts you want to tell? (According to my PM, this rule won't help you).
Shorter = better.
Simpler = better.
Limitations are part of problem statement. Especially small limitations, because for small data you can try all the possibilities.
Samples are part of problem statement. After building math model, check that you model working correct on samples, at least on small samples where you can check everything fast.
Notes are part of problem statement.
Try to find familiar patterns, maybe objects you already know something about. If you are given some connected graph with exactly one simple path between each pair of vertices, it's called tree. 4 letters instead of 12 words, see?
Try even harder to spot something strange, something you not expecting. That probably will be the cornerstone of the problem.
If there is some part of the statement you don't like, try to change that to something you like. Start with understanding the object, then simplify it. There are some problems which can be completely solved by this technique.
If the model you get is very big, try to split it into some pieces. It would be great if pieces are independent, like 'solve problem1, then use its answer as input to problem2 and so on'.
On first stages it can be useful to write your new statement. On paper. By hand.
Problemsetters do not write random things in statements. But why would you believe me, since I'm a bad problemsetter? I don't know, maybe you shouldn't.
So that's all from my side today. Assuming It will help you next time when you read any problem.
Here is the link of my competitive programming platform's account :-
Thank You for reading ...!!!
Subscribe to my newsletter
Read articles from ROHIT SINGH directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
ROHIT SINGH
ROHIT SINGH
Passionate about learning new tecnlogies and tools and exploring the world of Technology.