How to figure out what the question is actually asking??

Can someone please help me, sometimes I read the problem question and can’t figure out what the problem asking me to do. Like with the recent contest’s question “Chef and mover”, I got 2 subtask AC but rest of them all wrong. After the competition, I read comments like people over-complicated or misunderstood this problem. Same with the problem “Rainbow”. Are there any techniques to tackle the problems like that? Sometimes, I feel like there are not enough input and output explanations to tackle the question but then I see people are actually getting that question right in just one attempt!! Can someone please suggest a good way to figure out what the problem actually asking to do? I believe it will help people who just started Codechef like me.

Hey Kunal,

Don’t get disheartened by seeing other people solving the question in just one attempt. At first all the question seems tough. If you will practice well you’ll get the question AC in just first attempt.

> Please go through my answer on how to get good at problem solving.

Hope it helped!


Thank you, I’ll try my best and can you suggest me how to learn algorithms. Do you know any YouTuber who teach algorithms? since I’m a visual learner. Thank you!!

YouTube videos by mycodeschool really helped me alot learning new algorithms. you can follow them.

@sandeep_007 thank you so much for the help, I will check out the videos

It depends on many factors, most dominantly how exposed you are to competitive coding.

There exists a category of setters (lmao include me if i start setting problems) who make sure to twist the problem statements thoroughly, to make sure the contestant isnt able to make head or tail of it and has to go by his confidence and intuition on what is going on.

If you look at Q of STRINGRA, the setter left no stone unturned to give people a tough job. Else, the problem is very easy but for the difficulty in untangling it.

It will come by practice.

Rainbow array and chef and mover were simple statements, they werent complicated or hard to understand. If you feel that they werent clear, then please discuss them here so we can help you. More often than not, I find that its a “one directional” or lopsided thinking of contestant which makes things complicated for him.

Also, give a look to good coders solution, sometimes that really helps!

1 Like

I was able to solve the “rainbow” question but wasn’t able to solve the "chef and mover problem Can you please look at my code and tell me what was wrong? If you don’t have time that’s okay I know it takes time to understand someone’s code. But thank you so much for the help!!

I will, just wait for 30min plz, there is a contest going on atm

Check how your code is doing for this test case-

5 1
1 1 1 1 6

The answer is 10 but you are printing only 1.

Thank you so much @vijju123

@vijju123 can you please tell me what atm is? the contest?? where? at codechef? Thanks

Atm is a short form for “at this moment”. The contest was on codeforces

yes @kunnu120 i completely get your point about this understanding of the problem and then coming to the solution part , as @vijju123 mentioned , i will further add that i too faced similar problems as you are facing when i started with contests , i will suggest you to practice more from the scratch , you can start with past long challenges , and there if you get stuck , forum and editorials are there to help out.
only one way is there to practice these sort of problems , once you get hold of the problems , am quite sure that it will help you out in solving more loads of questions and understanding it at less time , and moreover i will suggest you that before the next long challenge comes over , its better that if you practice a set number of problems daily , to improve , this will surely help , if you set a goal of doing at least 4-5 problems daily at the beginning and then increasing your count and difficulty level :slight_smile:

1 Like

@raj79 thank you for the advice. I will try it. Thanks again