Jan 30, 2003: I rewrote large parts of this page and included some screen shots.
Recently I've spent quite a while in practice room 1, answering questions of newbies, looking at hundreds of programs and challenging some of them. From that experience, I thought it might be a good idea to address some issues I came across there. First some more important things.
General note: TopCoder sometimes changes its website/system a bit and I might not be able to keep this page up to date, although I'll try to. You can help me - when you notice a mistake here or would like me to include or rewrite something, please let me know.
Ok, let's begin...
TC = TopCoder (a commonly used abbreviation)
SRM = Single Round Match (another abbreviation you should remember). This is just one match, not one of the tournaments TopCoder offers every once in a while. There's usually one SRM each week. Look at the schedule for more info.
Arena = The TopCoder Arena applet. This is the main TopCoder system (other than their website). It's a Java applet that allows you to chat with others, register for contests, participate in contests, practice in practice rooms, etc... I'll show you some screenshots soon.
Before you can use the Arena applet, you have to become a TopCoder member. It's free, you don't have to buy anything, you don't get spammed, it's all good ;-) There are also some parts of the TopCoder website that you can't access unless you're a member. This includes the "Algorithm Discussion" round table and solution programs of other members, so you're really missing the coolest parts if you don't join the party.
There are several ways to start the arena and each has it's own advantages and disadvantages. You should try several of them to find out what's the most convenient way for you.
With a webbrowser. Click on the "Competition Applet" button on the TopCoder website.
With an appletviewer. Start it like this:appletviewer "http://www.topcoder.com/?t=arena&c=arena"
With Java Web Start. I haven't tried this yet, but you can find out more about this on the bottom of the TC website start page under "Java Web Start".
With your own applet viewer application. I do not recommend this, although this is the way I do it ;-)
In all cases, a little window will pop up with a "Load Competition Arena" button. Click on it and then enter your TopCoder login and password in the next window:
I addition to registering as a TC member you also have to register for each SRM you want to participate in. Registration begins 3 hours before the start of the contest and ends 5 minutes before the start. Look at the schedule to get to know about times of future contests. You might be in a different timezone than TopCoder, so find out the TC time by clicking on "[Get Time]" in the upper left corner on their website. Alternatively you can click through "Active Contests" -> "(The Contest)" -> "Schedule" to get a detailed schedule already translated to your timezone (hopefully correctly ;-).
You register for a match inside the arena applet. Click through "Active Contests" -> "(The Contest)" -> "Register" and then follow the instructions.
Shortly before the contest (usually about three minutes, you'll get a popup-window with a message that tells you) you can enter your contest room by clicking through "Active Contests" -> "(The Contest)" -> "Enter".
I strongly recommend that you just go ahead and play around with the Arena applet and the TopCoder website. Click on everything you can to find out what it can do for you. There are lots of treasures out there and I won't explain all of them here. This is how the Arena looks like when you enter it:
TopCoder matches have four phases:
Coding phase (75 minutes) - People read the problems, write solution programs and submit them. The programs are not evaluated in this phase, so the points you get are not final, you might lose them in phase 3 or 4. The Arena will look similar to this in the coding phase:
Intermission (5 minutes) - A short break to calm down, refresh yourself, chat with others, prepare challenges for phase 3, ...
Challenge Phase (15 minutes) - You can look at other people's programs and challenge them. If the program fails on your challenge input, your challenge is "successful", you gain 50 points and the poor guy/girl loses all points for that problem. Otherwise you lose 50 points. Each program can be successfully challenged only once. So don't look for bugs in programs that were already successfully challenged by somebody else unless you search for new challenge ideas. Note that you can't challenge if you don't have more than zero points and you can't challenge a program twice, so you might want to be careful. But don't be too careful, otherwise somebody else will be faster ;-) How do you challenge? Click on the bright "Summary" button. The following window will pop up:
Here you can see some information about who did what. Right-click or double-click on the points somebody got for his/her solution. This will pop up another window showing you the program and with a "Challenge" Button". If you find a bug, click that button. Then you have to enter an input on which you think the program will fail. This input has to be valid as defined in the problem description. You can *not* challenge somebody with invalid input.
Note that in the practice rooms (choose one with through the Arena menu) all this works exactly the same way as in real matches, but of course there are no time frames, so you can submit/challenge/... whenever you want to. During a real contest, you can't challenge or even look at solutions of others before the challenge phase.
System Testing Phase (? minutes) - Here you just relax and wait for TopCoder to test all submitted programs with their own inputs they prepared in advance plus the inputs from successful challenges by us in phase 3. If TopCoder has no problems, it should take somewhere between 10 and 30 minutes. Sometimes they have to fix things first, so it can also take much longer...
Many people wait in the lobby chat room ("Lobbies" in the menu) and there's always a lot of discussion going on there, including the current status of the system tests. One advice: When you just entered the lobby and want to ask the admins something, wait 20-30 seconds. Usually if there's an issue with the system test or something like that, dozens of people ask the same questions again and again and the admins have to give the same answers again and again. Their time is spent more wisely fixing the issues.
The input is always guaranteed to be valid. You don't have to write extra code to check if it is valid. Each problem exactly states what a valid input is. Read that part carefully.
How many points you get for a problem depends solely on the time it took you from first opening the problem description until you submit a solution for it. There is no penalty for compiling and testing. Note that if you open a problem, close it again, solve another problem, and then return to the first one, that the clock for the first one was ticking all the time. Also, the points do *not* depend of the elegance or speed of your solution. Well, you'll lose all points if you're too slow (need more than 8 seconds), so that was not exactly true.
Since SRM 88 we have the possibility of multiple submissions. That is, you can replace your solution with another one as often as you want to. However, you will be punished by losing 10% of the maximum points every time and furthermore of course the clock kept ticking.
In practice rooms you can run the system tests that were use in the original contest by going through the menu item "Practice Options". You should always do this when you've finished a program to make sure it is correct. And it's so easy to use, just two clicks away. Note that it can take some time (about 10-60 seconds) until the popup-window with the results appears, so just be patient.
You can also clear your problems and then resubmit them. If you have a problem window opened, close it first, otherwise it won't be cleared properly. And don't forget to have your code locally on your own machine in a file or editor (not in the applet), because it will be deleted on the TopCoder server ;-) Well, since multiple submissions are allowed now, this feature is much less important than it was before.
In Java and C# you have to make both the class and the method public. In C++, only the function needs to be public. As a demonstration of what a solution looks like, I'll show you solutions for the easy problem in practice room 1. Note that these solutions do the wrong thing, because I don't want to steal the fun of solving the problem from you. But they still show you the general structure you have to write. All that's left to do is to change the function body so that the program computes the correct thing...
Java
public class Pencil { public int bestPencil ( int[] deviations ) { int sum = 0; for( int i=0; i<deviations.length; i++ ) sum += deviations[i]; return sum; } }
C++
#include <vector> #include <algorithm> using namespace std; struct Pencil { int bestPencil ( vector<int> deviations ) { int sum = 0; for( int i=0; i<(int)deviations.size(); i++ ) sum += deviations[i]; return sum; } };
C#
public class Pencil { public int bestPencil ( int[] deviations ) { int sum = 0; for( int i=0; i<deviations.Length; i++ ) sum += deviations[i]; return sum; } }
Now some more things that came to my troubled mind but that are not so important. They are also more like advice from myself and other people might have different opinions about some of this. Feel free to hate me if you disagree with something. Or better, tell me about it and I might change my mind.
Practice in practice rooms. Solve problems and challenge others there. If you can't find a bug in programs of others, look at already successfull challenged programs. They do contain bugs and you can still try to find them and improve your challenging skills.
Quite a few people tend to use their own IDE locally on their own computer. Writing, compiling and testing the programs might be easier for you in your own environment than in the TC arena applet. You can the just copy your code to the applet when you're done. Some of the Arena plugins you can get from the TC website might be helpful to support you.
Use the round tables on the TC website. People discuss problems and solutions and all other stuff there.
Use the chat correctly, especially in the lobby chat room. There are so many people writing at the same time that one can easily miss something if you don't address it to her/him so that it gets highlighted for her/him. You can do that by clicking on "<<" on the left of where you enter the message and then choose "reply to" or "whisper" and the name of the person. Alternatively you can also enter something like "/mesg TheSlayer blah blah...