How to make the transition to functional programming?

Is it worth it to make a transition from SPOJ to TopCoder? If yes, when do you suggest to shift to TC and participate in programming contests?

  • I am 3rd year CS student from BITS . I've been solving problems on Spoj for about an year now and have solved around 200 problems. But I don't usually participate in programming contests. Basically, I want to know how is topcoder better than Spoj? And should I make a transition to Topcoder. I've a low cgpa of 7.2 and do not want to spend too much time getting used to Topcoder.

  • Answer:

    Thanks for the A2A. I would suggest shifting to Topcoder ASAP. If you have time management problems, i would suggest stick to Topcoder practice alone for a while. Reasons: 1) Quality of problems: The quality of problems in Topcoder is very good however same cannot be said of SPOJ, especially many of the new problems. 2) Live Contests: Topcoder conducts Single Round Matches (SRMs) very frequently (about once a week or once in two weeks) whereas SPOJ doesn't have recurring live contests. This helps you to develop speed in solving problems. 3) Incremental development: This is one of the most important features of Topcoder. Problems are segregated as Div 1 (Tougher) and Div 2 (Easier). In each division there are 3 problems - 250 (Easy), 500 (Medium) and 1000 (Hard). So, you could start at the Div2 250 level and move your way up. If you are not able to progress from a particular level, you could practice lots of problems of that level from the practice rooms until you get comfortable. This also solves another problem with SPOJ: problems are not ordered by difficulty, so you might fall into the trap of wasting time solving easy problems. 4) Editorials and reading other people's code: Topcoder publishes editorials and gives access to code of participants for all of its past contests. So you get great insights into solving the problem in different, clean, elegant ways and also to develop good coding practices. Also, you get to learn some nifty tricks to increase speed such as using #define's and templates (although the benefits of using these are debatable). 5) Challenge phase is another feature where you get to challenge other people's code by sending in test cases. This helps you develop good debugging skills.   A few cons: 1) Lesser genres of problems: Topcoder tends to concentrate on a few genres of problems and its unlikely you would face a question on Segment Trees, Minimum Spanning Trees etc. if you are in Div2. This might be either a boon or a bane since at this level you should be focusing more on improving your basic problem solving skills and speed rather than learning tougher algorithms. However if your interest is in exploring algorithms rather than incremental development, this might turn out to be a bane. 2) Problems are not ICPC style: Topcoder is a great site to prepare (in fact it is the site recommended by most top performers in ICPC). That being said, it does not archive ICPC style problems. If you are looking to prepare for ICPC, you should also solve previous year ICPC problems from SPOJ or LiveArchive to get a feel for it. 3) Input / Output: Since you have solved about 200 SPOJ problems this should not be an issue for you. Adding just for the sake of completion. Topcoder removes the need for doing I/O by giving input as method parameters and takes output as a return value. So, you might miss out on certain concepts like Fast I/O, parsing inputs etc. I would say, the pros of using Topcoder far outweigh the cons.

N Hari Prasad at Quora Visit the source

Was this solution helpful to you?

Other answers

Thanks for the A2A. Firstly, allow me to "judge" you based on your question. Since you have solved around 200 problems on , you are certainly close to blue level on . I can see you advancing to Div1 in your first SRM (provided you know how the arena works, ofcourse). Secondly, about your use of the word "transition". If you do start doing SRMs, you won't be stopping SPOJ completely, will you? If so, don't! What you should do isn't as much a "transition" as simply starting to take part in SRMs. Now let me answer your question. I suggest you start doing TopCoder asap. First learn how to use the arena properly, then solve about 4-5 problems in practice (it's ok if they are mostly Div2 250s). After that you will be ready to attempt a live SRM. Then you can start thinking about rating and color. About "which is better", it depends on you really. Do you want to solve problems in the order easy-medium-hard (TopCoder) or do you want to solve a set of problems involving similar approach all together (SPOJ)? My suggestion is to primarily attempt to solve TopCoder problems. But if you aren't able to solve one, and later find out it involves a "new" algorithm, then you can read up on it, understand it, and solve a few SPOJ problems on that topic. Then come back to the TopCoder problem and try it again! Lastly, don't let this affect your CG. together with screwed mine! Your current CG isn't too bad, but it isn't great either. (Mine is nearly the same, so no more comments on CG! :P) If you want me to add anything more, you can write it in comments.

Varun Nitish

SPOJ: akhiluanandh TC: akhilu Thanks for the A2A. I wouldn't use the word "transition", really. It's not as if the two are completely on  different planes, or as if you can't do both; and there isn't really much time you would need to spend to get "used" to Topcoder. Topcoder gives you the feel of a real contest environment. The experience of participating in a live contest is not something you can get for SPOJ. The problems on TC are categorized by difficulty levels as Div 1/2 250/500/1000, which is a useful classification rather than the mixed bag of problems on SPOJ (the number of users who have solved the problem does give a rough indication, but is often misleading). The quality of problems on SPOJ has degraded over the past few years. Problems added before 2010 (by some really good problem setters) are far better than the ones added in recent years. However, the points system of SPOJ is designed to award more points to problems solved by less users (which is the often case with recent problems despite them being easier than many of the older problems), giving users a misplaced sense of superiority. Whether or not you realize it, points do tend to be a motivating factor in choosing problems to solve, and it is very easy to fall into the trap of spending much of your time on SPOJ solving recent and easy problems, which are of little use in terms of learning. I would advise you to follow the list of solved problems of former ICPC world finalists on SPOJ or high-ranked coders you may know who have been inactive in recent years, as I have found these to contain some really good problems (which may give you less points than recent problems, but have much more to learn). Topcoder, on the other hand, has preserved its quality of problems over the years (by hand-picking its contest writers), and has a far better ranking system (which takes into account only live contests). Your topcoder rating is a real indicator of your learning curve. Topcoder also has really good editorials to help you when stuck during practice. I would therefore advise you to start Topcoder. Do not give up SPOJ completely, but look for good problems on SPOJ. Hope this helps. Cheers!

Akhilesh Anandh

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.