From where do I start ?

Hello,

I have been a Codechef user for past 1-2 years, and I am finding the Contest problems extremely difficult to solve. Maximum I am able to get only one or two correct, most of the time I get either WA Wrong Answer or TLE (Time Limit Exceeded). A few times, I am able to get the logic behind the problem and the test outputs, and I try for some other inputs and then also it works. Everything seems to be fine, but still the Codechef system tells it is either WA or taking too much time. I am getting frustrated, maybe I need to start with the practice problems first. But i do not know what level of practice problems should I start solving.

I have some knowledge about data structures, (like basic structures like arrays, stacks queues, linked lists and trees (simple trees not AVL trees or such stuff), basic sorting, graphs, algorithmic approaches like divide and conquer, dynamic programming, I donot know advanced things like Hash Tables, and I code in C/ C++.

SO could someone tell me from where to start ? What level of practice problems or sample problems would be appropriate for my level.

1 Like

start with what you already know. hey, you can always google how to do hash tables. and you can also learn another language aside from c/c++

SO is the medium level problem a good point to start ?

Medium problems can get hard to solve; therefore, I would recommend you to solve the hard ones (with less successful submissions) from the easy section and maybe the easy ones from the medium section. As you improve your programming skills, move on to harder problems or to contest problems!

The best way to practice is to practice during live contest. That way you will try to give your best, and hence more likely to solve the problem.

The data-structures and algorithms that you have mentioned, you know, are more than enough to solve 5-6 problems in each monthly challenge.

You are getting WA because, either you are not understanding the problem completely, or you have some bug in your code. For former case, I suggest you read the problem over and over again. Then you need to develop your own test cases which are slightly bigger than the example test cases. Test your solution thoroughly before doing any submission. For later case, well you need to trace your program manually or using a debugger.

And when codechef tells TLE, you need to reconsider your algorithm. So say you have O(n2) solution, see if you can reduce it to O(n log n) or even better O(n).

And if still you are unable to solve the problem, you need to read the Editorial of that problem, carefully. It is like a learning opportunity. Next time if a similar problem comes up, you will be able to solve it.

Hope this helps.

2 Likes
//