Skip to main content

Practice Opportunities

Numerous opportunities for practice exist on the web. For newcomers, I would particularly recommend CodeForces and the ACM Online Archive (#1 and #2 below).

  1. The ACM-ICPC Live Archive (also via livearchive.onlinejudge.org) is the official record of all problems that were posed at ACM regionals or World Finals, going back to 1990. It uses the same software as the UVA Online Judge. For example, here you can find the Midatlantic 2013 Problem Set (no longer available).

  2. CodeForces is the site where top Russian coders practice. It was founded by Mike Mirzayanov, coach of the Saratov State University ICPC team.

Here is a brief breakdown of how it works:

  • Getting Started: after you create an account, try submitting a problem. Here is a 2:45min YouTube video I created that shows how. You can pick any problem available on the site, but it is best to choose a problem A or B from a Div 2 contest. In the video, I'm submitting this problem.
  • Users are assigned to one of two divisions, based on their rating (Div 1 for those with a rating > 1700, and Div 2 for everyone else) After each competition, ratings are updated based on a formula that calculates how well you should have done based on your current rating, and adjust your rating if you exceeded this threshold or fell below it.
  • A typical 2h competition is a "Round", and it has 7 problems in increasing difficulty. However, each division only solves 5 problems: Div 2 solves the 5 easiest problems, Div 1 solves the five hardest problems, and the middle 3 problems are solved by both divisions. That means that Div 1's problems A, B, C is Div 2's problem C, D, and E.
  • Sometimes they hold special tournaments sponsored by other companies, or sometimes (if they can't come up with 7 problems), they may do Div 2 rounds only.
  • Scoring is different from ACM-ICPC. Unlike at ACM-ICPC competitions, where you receive final feedback on a submission based on all secret judge tests, at CodeForces the tests are divided in two groups, somewhat awkwardly called "pretests" and "system tests." During the competition, you only receive feedback on the pretests. The system tests are run after the competition and determine your final score/ranking. Often times, corner cases or large input sets are found only in the system tests, so an inefficient or incomplete solution that passes the pretests may not pass the system tests.
  • Scoring schemes. Unlike at ACM-ICPC, where the score depends on the number of minutes elapsed since the beginning, the scoring here is based not only on time, but on the difficulty of each problem. Typically, A is the easiest and E the hardest. The number of points achievable decreases as the competition progresses, down to some minimum. Like at ICPC, there is a penalty for submissions that fail the pretests. The nominal value of each problem at the beginning is an estimate of the problem setter how hard a problem is. Since it can be difficult to estimate how difficult a problem is, some contests use Dynamic Scoring, in which a problem's point value is determined in hindsight based on the number of contestants who solved it.
  • Hacking. In codeforces rounds, you may decide to attempt to find test cases that break other competitors solutions. Such attempts are known at "hacking" and if successful, increase your score. If unsuccessful, you lose points. You may start hacking only after you "lock" your own submission to a problem (preventing further submissions.) Note that you cannot copy and paste other contestants code (it's shown as a non-copyable graphics) to test if your hack will be successful. The hacked contestant will have a chance to resubmit their code to overcome the failed test, unless they have already locked their solution. Test cases from successful hacks will at the end of the contest be added to the system tests to which all submissions will be subjected. You may only "hack" solutions submitted by the contestants in your "room" - post registration, you will be assigned to a room for that purpose.
  • All submitted code is publicly accessible after the competition, which is a great learning tool. There's also typically an editorial after each competition. If you don't wish to see a full solution, not that after the competition, you will see the first test case you're failing, allowing you to fix your program. The scoreboard for a competition will also show if you solved a problem afterwards so your team members (and I) can see it.
  • Virtual Participation. If you miss a round, but wish to compete as if you had been there, use the "Virtual Participation" feature. This will allow you to do the competition within the same time frame at a starting time of your own choosing. You can then compare yourselves to others who did the competition in real time and see how well you would have done. We have done virtual participations in the past if we had to miss the actual competition because it was midday.
  • Note: During a virtual participation, you will see the number of problems solved by others as they were at the time of the actual competition. So if you see few problems solved 30 minutes into your virtual participation, don't assume it's a really hard contest - it just means that during the actual competition, contestants had solved this many problems. You will also see what your rank would have been during the competition. When the competition ends, your rank will be adjusted to take into account that system tests may have failed for the actual contestants.
  • One difference appears to be that the system apparently runs both the pre- and system tests when you do a submission, so you'll see immediately if a problem was judged correctly, rather than at the end. (Observed when doing Looksery Cup 2015, can someone confirm this is true in general?)
  • The registration for virtual participation can be done in advance for a given, shared start time, but you can also register (and start) at the very next minute, or even in the past for a shortened competition. Keep in mind, however, that the time shown is using a Russian time zone. The dot corresponds to 'now'. For best results, you should register a few minutes before the shared agreed upon time.
  • Friends. You can friend others by clicking on the star next to their name on their profile page, , which is linked from our team roster. You can see friends under "Friends Standings" during a real or virtual competition. Unfortunately, there's no way to friend others in bulks, so you have to friend everyone on the team.
  • Important hint: If you register for a rated competition in Div I, but then fail to submit anything, it will not count (negatively) towards your ratings. Is it not clear if that is also true for Div 2, so if you've registered and then can't compete you should unregister before the competition to avoid a negative impact on your rating.
  • Groups. We also have a group on codeforces to which I invited everyone. The group can be used for separate tournaments, although those will not have pretests and system tests.
  1. Kattis.com is a Swedish online judge with a nice user interface and many problems to practice. Kattis has been hosting the World Finals over the past years, along with a number of North American competitions. The ICPC world finals problems are at icpc.kattis.com.

  2. UVA Online Judge was created by Miguel A. Revilla from the Universidad de Valladolid in Spain. It is one of the oldest online judges, containing thousands of problems.

All sites based on the UVA software works similar. Submission in Java is a bit awkward: your main Class must be called "Main" and not be in a package. UVA currently supports Java 1.7, but the ACM-ICPC Live Archive and programming challenges appear to only support 1.6 (the use of 1.7 or Java 8 features will lead to runtime errors there.) Occasionally, your browser may refuse to visit the site because of an infinite redirect loop; in this case, clear all cookies you have with any domain with 'onlinejudge' in the name. The sites are occasionally down, but usually come back up. For some problems in which multiple outputs are allowed, the site may not have the necessary 'judge' program to accept correct solutions whose output varies from the problem setter's solution. Those are marked yellow on the ACM ICPC archive.

  1. Programming-Challenges.com contains the problems discussed in Skiena & Revilla's book: Programming Challenges: The Programming Contest Training Manual, Springer 2003. These problems are all over the board and still make for challenging practice. List of problems PC lacks a judge for.

  2. Topcoder is a site where algorithm contests (called Single Round Matches) are held a few times a month. Competitions are usually 75 - 120 minutes and include a "hacking" component, allowing you to submit test cases that break others' code. Anually, they hold the Topcoder Open, which is a multi-event tournament, similar to the Google Code Jam in the style of qualifying.

  3. Code Chef is an Indian based programming competition site. They hold some normal length (2-5 hour) competitions, as well as some longer ones (9 days). They have a lot of interesting problems, though sometimes the problem statements can be vaguely worded. Similar to Codeforces.

  4. HUST Virtual Judge is an online judge aggregator. HUST allows you to submit to any problems from over 18 online judges, as well as create custom competitions, pulling from any problems on those online judges. Expect to do a few of these a month.

  5. SPOJ The Sphere Online Judge

  6. HackerRank is an online site that offers a number of problems that are tagged with respect to area.

  7. LeetCode Online Judge is a platform for preparing technical coding interviews. Pick from an expanding library of more than 150 questions, code and submit your solution to see if you have solved it correctly. Coding involves single functions, and it is guided in that you see failed test cases.

  8. Others: