9/28/2014 If I am not good at solving the problems on the sites like CodeChef or Hackerrank, where am I lagging? - Quora

QUESTION TOPICS If I am not good at solving the problems on the RELATED QUESTIONS competitive programming sites like CodeChef or HackerRank CodeChef: I am in my third year of Hackerrank, where am I lagging? university now. What should be my Codeforces strategy so that I am comfortable with I am a second year undergrad at one of the IITs and very decent with my CPI Sphere Online Judge solving problems of gene... (continue) (SPOJ) as of now. I have tried quite a few times to start with the likes of above mentioned sites but even the basic level questions take a long time for me to : Why am I CodeChef unable to concentrate in problem solving, get completed? If I know the , if I understand the coding, reading, poor at math? questions, where is the fallacy on my part that is preventing me from getting Competitive over them(solving questions) quickly and efficiently? I am quite motivated towards Programming programming, but there is a phase when I am unable to solve most of the problems. Software Follow Question 190 Comment Share 2 Downvote How do I ge... (continue) Programming Languages I am new to competitive programming, just joined CodeChef 10 days back. I am Indian Institutes of Sumit Saurabh finding the easy level questions very Technology (IITs) Edit Bio • Make Anonymous difficu... (continue) Write your answer, or answer later. I am new to programming. I have been Computer doing problems from sites like CodeChef Programming and SPOJ. For some problems I am 10 ANSWERS ASK TO ANSWER Edit Topics exceeding th... (continue)

Anonymous I am only able to solve 3 problems in a SHARE QUESTION 318 upvotes by Abhirut Gupta, Rajini Maski, Harsha Nadimpalli, (more) long CodeChef contest and 1-2 problems in cook-offs . What should I do so that I First of all, i would like to introduce myself a little, regardless of being ... (continue) Twitter anonymous, so that you get comfortable. I am a second year undergraduate at Facebook one of the IITs too, and i have been doing competitive programming for a Competitive Coding: I am not able to while. No, i am not that great at it, but i am just learning, and currently i am solve more than 2 questions in Codechef's Long Contests . How to able to crack 5-6 problems in the CodeChef Long Challenges. Long way to go! :) QUESTION STATS improve my coding le... (continue)

Views 32,953 Yeah, now to begin with your question, i find myself appropriate to answer that How do I solve tough programming question, because i have been through that phase. So, what i found was, to do problems in CodeChef? Followers 190 good at competitive programming, atleast to be a medium-level guy, which i CodeChef: I am facing problems in consider myself now, you should do it in phases. solving topcoder div1 250 problems. Where am I lagging or going wrong? 1. The CAKEWALK Phase. Latest activity: 2 Sep First, of all there are questions that do not need any prior knowledge except CodeChef: I am confused when to read simple logic and the basic syntax of a programming language. All you really the theory and pseudocode or code of specific types of problems.Should I derive need is to know to write a language, and simple logic to work it through. I them on my own ... (continue) would grade these problems below as cakewalk. More Related Questions Chef and Feedback The Best Box

So, if you can easily get away these ones, congrats! you are now into the next phase.

2. The STANDARD Phase. Now that you are done with the basics of a language and easy problems, you should know some basic standard and their applications. If you notice closely, there are always some problems that are just the standard implementations of standard algorithms. I would consider knowing graph algorithms (dfs, bfs, shortest paths, minimum spanning tree), dynamic programming, data structures (segment trees, suffix arrays) etc in this phase. If you know these algorithms and what they really do, a little bit of thinking on most problems would make you convert them in some kind of standard algorithms, or their applications.

Now there are two ways, you can go about this, you either learn an algorithm, https://www.quora.com/If-I-am-not-good-at-solving-the-problems-on-the-competitive-programming-sites-like-CodeChef-or-Hackerrank-where-am-I-lagg… 1/6 9/28/2014 If I am not good at solving the problems on the competitive programming sites like CodeChef or Hackerrank, where am I lagging? - Quora and then practice it, or you practice questions and learn the algorithm that needs to be used to solve them. I personally prefer the latter, because it makes you think of all possible ways of solving a question, and only when you are sure you learn the new way, and it remains longer in your mind. But, then this is my way. And if you really want to try and trust me, i would consider Sphere Online Judge (SPOJ) as the best place for this.

Once you know these standard algorithms, and have practiced a lot, you will be easily be able to solve half of the probelms. You'l be me :)

3. The OPTIMIZATION Phase. Disclaimer: I myself have not been able to complete this, but i think this would be the best thing to do for me, next.

Now, at times when you see a problem, you know an approach for the problem. But you need to do it better. With better it may mean the time constraint on the Search problem, or the space constraint. For better uHnodmerestandinOgp,e in w Qilul egsivtieo nysou an Notifications Sumit Add Question example. This was a problem in last month's long challenge i guess, A Story with Strings . Now i know i could do this using suffix arrays, and in fact me and my team-mate spent a lot of time implementing it, but we got stuck with the time constraint. It needed a O(nlog^2(n)) implementation,and i had no idea how to. So this is the phase, when you need to improve yourself, and i guess there is no 'defined' way to do this, and all i guess is i need to practice and learn!

4. The ALL-MATHS Phase. Now, this is divided across all the phases. You need to have a good hold on , probability, and geometry at times. I struggle with this part, and may be you could help me out with this. :)

At, the end, all i would say is, what i found was, the only was to improve yourself at competitive programming is practice! The more you do, the better you get. Don't give up, trust me the happiness of a 'GREEN TICK' is unmatched! Happy Coding :)

P.S. This is my second longest answer on quora, i guess! And all the suggestions were my own personal opinion and experiences. It might or might not work for you, but i guess, it's worth a try.

P.P.S All the suggestions are welcomed for improving the answer, and all ideas for making myself better at competitive programming, Thanks! :) W ritten 5 Apr. Suggest Edits

Upvote 318 Downvote Comments 3+ Share 4

Amit Upadhyay, Programming addict/Maths Lover... (more) 296 upvotes by Sumit Saurabh, Dhaivat Bhatt, Senthil Nathan, (more) I am not even from IITs. I am still a novice at competitive programming. The thing that I have is passion for what I need to do. I am able to solve 6-7 question in codechef long challenges and that too by a humongous effort. But I still go on. I just have two things to say in your case. First,

Mind is everything. What you think is what you become. -Buddha Yes, think that you will succeed and practice. Believe me in programming world only a handful are prodigies, rest of the top programmers are there because of their hard work, passion and dedication. Did they had same doubts as you are having now? Yes I can tell for sure. But they put those doubts aside and just did the hard work.

Secondly, don't take programming as a work. Take it as a part of your life just like your breath. Enjoy it. Love it. If your inner voice says, you can't code, then just code. It is the only thing that'll shut that inner voice. https://www.quora.com/If-I-am-not-good-at-solving-the-problems-on-the-competitive-programming-sites-like-CodeChef-or-Hackerrank-where-am-I-lagg… 2/6 9/28/2014 If I am not good at solving the problems on the competitive programming sites like CodeChef or Hackerrank, where am I lagging? - Quora

You are not lagging anywhere if you are trying. Even if it take too much time, the thing is that you tried. You are improving yourself slowly. Any thing does not happen in an instant unless it is destruction. So construction of a great programmer takes time :). It is up to you if you want to hang on.

There is a pretty good maths behind it. Assume your value is . Now you program daily even if it took you whole day you learnt a new thing. Let us say you improved yourself by . Now at the end of the day your value is . You think there is no change what so ever BUT.

If you do that daily. .

In one year you are 37.8 times you were 1 year earlier without even realizing that you are better :) So remove the doubts and code on. The thing you are lacking is Sincere Action. So just do code, enjoy code, love code.

Happy coding :) cheers U pdated 28 Aug.

Upvoted 296 Downvote Comments 6+ Share 5

Kunal Suri, A wannabe programmer. 79 upvotes by Mathew Jose, Ritesh Pratap Singh, Tushar Makkar, (more) I am a second year undergrad at one of the IITs and very decent with my CPI as of now.

Being an IITian and having a decent CPI has (very little,if any) correlation with being good at competitive programming.

I have tried quite a few times to start with the likes of above mentioned sites but even the basic level questions take a long time for me to get completed

You just did a few problems and because you were unable to solve them in a giffy, you thought low of yourself.

If I know the programming language, if I understand the questions, where is the fallacy on my part that is preventing me from getting over them(solving questions) quickly and efficiently

Knowing a programming language and understanding questions comprise a very small fraction of algorithmic programming. Practice is what enables you to turn your understanding of the problem into a solution.

You might know all the data structures in the world. You might have read the complete CLRS/TAOCP but unless you don't solve problems EVERY-freaking- DAY, you will continue to consume a lot of time in solving such problems.

Solving problems efficiently require even more time because you need to learn about improving your present solution. https://www.quora.com/If-I-am-not-good-at-solving-the-problems-on-the-competitive-programming-sites-like-CodeChef-or-Hackerrank-where-am-I-lagg… 3/6 9/28/2014 If I am not good at solving the problems on the competitive programming sites like CodeChef or Hackerrank, where am I lagging? - Quora

Anonymous gave an excellent roadmap for improving yourself. Also,I couldn't agree more with what Prashant Bhattacharji said about practice. However, I believe that this whole 10,000 hour rule becomes a recipe for procrastination because it's very easy to lose your vision with such a huge target in mind.

I would suggest following the "20-hour rule to learn anything". 20 hours is a small amount of time, just enough to be tracked but large enough to learn something - becoming good at it is then a matter of time.

The following video might help in this regard:-

Break down what anonymous said into tasks that can be done in 20 hours. Follow the advice given by Josh (of the video) and start working. W ritten 5 Apr.

Upvote 79 Downvote Comment 1 Share 1

Neeraj Sinha, A listener, and an open source... (more) 12 upvotes by Amitoj Kaur Chawla, Vamsi Pavan Mahesh Gunturu, Dhaivat Bhatt, (more) Buddy, I am in your category only. Don't feel low of yourselves. Well, I am not a student but a working professional who doesn't find enough time to devote on the sites you mentioned. When I was a student, I could only know about SPOJ and TopCoder, but I never gave a try. Sad!!! I still feel bad about it.

But anyway, learning never ends. I joined Hackerrank and Codechef, solved practice problems first. It gave me a good confidence. I even try participating in long and live challanges, but in a very similar fashion like you, I end up solving not more than 1-2 problems. When i see myself in the leaderboard, it's frustrating, but you know what I don't feel bad because there more folks who are down the rank than those who are above me, and this story still continues and improves itself. Only thing I need to do is not to stop trying. In a recent HackerEarth challenge, i managed to secured my place in 5th page of the leaderboard (23 pages of ranks of around 2200 participants)

Coming over to programming skills, honestly, I don't have any. "When I think a way to solve a problem, i end up opening n number of stackoverflow tabs in my browser just to see how I can safely implement it". I remained bad at programming even when I was student and till date as well.

I read blogs and editorials on these sites in my free time, I would recommend you this.

You are a student and that's a plus, your hunger for learning will make you excel in the course of time. I lacked this in my student life, you should not. https://www.quora.com/If-I-am-not-good-at-solving-the-problems-on-the-competitive-programming-sites-like-CodeChef-or-Hackerrank-where-am-I-lagg… 4/6 9/28/2014 If I am not good at solving the problems on the competitive programming sites like CodeChef or Hackerrank, where am I lagging? - Quora

Happy Coding. Take care. W ritten 8 May.

Upvote 12 Downvote Comment Share

Lakshman Tiwari 9 upvotes by Ansh Khanna, Amitoj Kaur Chawla, Rahul Gandhi, (more) I am computer science graduate student from very poor Engineering college. First time I come to know abut programing language when I was in second year of my graduation and then I started learning c/c++. I found it very interesting, from that day I started learning and try to solve some SPOJ problems but find quite hard, after that I come to know about code chef and topcoder and then I started learning from old contests and by viewing others code how they have solved contest problems. Now I can easily solve SRM 250 problems . I have solved many hard problems on SPOJ (Total 370 problems with 124 points) . You can refer Topcoder tutorials, you can also refer forum many people posted suggestions about the problems. W ritten 12 May.

Upvote 9 Downvote Comment Share

Pawan Kumar 8 upvotes by Abhiram Ravikumar, Saikat Guha, Karan Kapoor, (more) While competitive programming is a good way to improve your coding skills . But it's not the only way . I'll advice you to do some personal projects which solving some real life problems . There you will understand why all that optimasation is needed . I was able to solve problems on spoj by putting some time but wasn't enjoying it . Built few games and really enjoyed working on those improving my skills at the same time. W ritten 18 Aug.

Upvote 8 Downvote Comment Share

Sumit Saurabh Edit Bio • Make Anonymous

Write your answer, or answer later.

Top Stories from Your Feed

https://www.quora.com/If-I-am-not-good-at-solving-the-problems-on-the-competitive-programming-sites-like-CodeChef-or-Hackerrank-where-am-I-lagg… 5/6 9/28/2014 If I am not good at solving the problems on the competitive programming sites like CodeChef or Hackerrank, where am I lagging? - Quora

https://www.quora.com/If-I-am-not-good-at-solving-the-problems-on-the-competitive-programming-sites-like-CodeChef-or-Hackerrank-where-am-I-lagg… 6/6