We've made it! Or in any case, we are at least very close to it.
On January 19, 2012 at 12:00 we open a sub-project called "Gym". In short, its goal is to enable the Codeforces coders not only to participate in competitions and discuss them, but also to train and coach easily.
In fact, despite the wide diversity of online judges in the world, a well thought-out training service system does not exist. So, the expectations from this system are:
- Collection of online contests, composed mainly of the past official contests.
- Opportunity to integrate the final standings of past contests in the online contests to be able to train "against" the official participants.
- Opportunity to participate in the training at any time whatsoever, without fear that something breaks down and the server will fall. In short, reliability.
- Opportunity to write virtual contests and to solve the problems in a practice mode.
- Opportunity to participate both individually and as part of a team.
- Opportunity to keep the team while changing the team members.
- Opportunity to view various statistics and participation history, the possibility to compile and publish reports on selected participants/contest.
- Opportunity for a coach to add an online contest by him/herself, if this contest still does not exist. The process should be simple, reliable and maximally automated. The opportunity to parse the final standings of the past contests. The opportunity to add the attempts of the official participants to an online contest.
- Opportunity to view tests or other players' solutions for those who have solved the problem.
- Opportunity to find the training to one's taste, i.e. selecting by parameters.
The Codeforces Project:: The training aims to meet all these requirements. Already, nearly everything of the above list is available and whatever is not, will be available.
Let's go! All images are clickable.
For the participants
Go to the "Gym" section and choose a contest to your taste. Pay attention to the stars, they show the complexity of the training session. Order a contest online (as can be done with the usual Codeforces rounds) and proceed to the solution! You will be confronted with other online participants as well as with ghost participants (those who took part in this contest one day and turned up in the Codeforces system due to the analysis of the final standings file of the past contest).
Please do not solve a training session if you do not intend to put your own real efforts into it or if you've already seen these problems. The only contest on which you can test the system is the "2010 Codeforces Beta Round #1 (the training)", but even there a coach will also be influenced by the inadequate participation.
As you participate in training, you guarantee that you solve problems without assistance and that you do not send other people's solutions. The coaches will have the authority to move your solution from the "online participation" type to the "solution modifications" type if they see that you have violated these simple rules. If we find that we have a large number of such inadequate people in our community, we will be forced to limit access to the "Training" section judging by the rating, the invitations or something else. I hope that this will not happen.
We have singled out a special role of a coach. Any red participant can become a coach as long as s/he is willing to make an effort to maintain and fill the "Training" section. Be sure to read the rules and obligations. Do not become a coach if you do not agree to follow them. You can enable/disable the coaching mode at any time. We understand that the presence of red is very tough. However, we want to try out the system for this limit. The fact is that the system is still rather crude on the one hand. On the other hand, we really do not want to make a mess there. Let's try to live with this limit, and play by the situation. Several additional coach accounts will be given out by us individually. Now let's proceed to the sweetest course - creating training sessions on one's own. To organize a training session you need the archive of the past contest:
- full tests (if generators are used, then the tests must be pre-generated), including files with answers for each test;
- original solutions;
- a final standings file in the form of the traditional ACM-ICPC standings in HTML (a link will do, you can also use the .dat file from TestSys).
Original solutions are not mandatory, but highly desirable. Checkers are needed only if the answer is ambiguous. The checkers must be compatible with testlib in terms by command line arguments (checker-file input output answer) and return codes (OK - 0, WA - 1 and 2, FAIL - any other value). Final results are also not required, but they can improve the training greately. Yes, we have a super-intelligent parser that can turn almost any HTML ACM-ICPC monitor into the participation log.
The "New Training" form
So first, click the "Create a new training session." If the contest doesn't have a Russian or English name, then just don't enter it. The start time may be omitted, but if you enter it, you can make not an online participation training but a full contest (which will then be available online). Leave the access level as "private" until the contest is completely ready. After that, it can be published.
Here goes very important information. The rules for naming contests are as follows: First comes the year when the contest was officially held (or a season, which is even better). There should be no spaces on either side of the hyphen in the name. Then follows the name of the championship (if there is any), then a rather detailed contest name. It can end with brackets containing the abbreviation followed by two digits representing the year. You do not have to use words "Programming", "Informatics" in the name. For example:
- 2008-2009 All-Russian National School Team Olympiad (VKOSHP 08)
- 2001-2002 ACM-ICPC Northeastern European Regional Contest (NEERC 01)
- 2008-2009 Winter Petrozavodsk Training Camp, Saratov SU Contest
- 2010-2011 LKSH, the August camp, problems on DP
Be sure to fill in the fields "Season", "Contest Type," "Country", "Location". You are advised to specify the country or the location by the place of birth or the place where the first original contest was held. In the advanced settings fill in the description, it will be available for the participants to view prior to solving problems. There you can specify the problem sources, if the training session is compiled from problems from different sources.
Codeforces Contest Wizard
The "Contest" tab
So, you fill in the "new training" tab, you press the "Create" button and you find yourself in the contest interface. The next step is filling the contest with problems. You should also add the ghost members, and their attempts from the final standings of the past contest. Read the blue box to the right carefully and open the Codeforces Contest Wizard. The first time it will take its time to open, but much will go the cache.
Carefully read everything that is written on its first tab. There's little text, and it will be useful. Are you done reading? Then click "Next".
The "Contest" tab can be used to adjust the training session length and select a file with the final standings which will be processed by the system. Select either a file (the HTML-document or the TestSys record in the dat format) or a link to it, then click "Parse". If all goes well, the "Problems" and "Teams" boxes will be filled automatically. If this does not happen, that means that the format is not supported. In this case, please let us know and add the problems one by one using "Problems:Add". If the problem does not have an English or Russian name, then leave them blank.
Then, click "Next", the application will add several tabs - one for each task.
The "Problems" tabs
At each of these tabs, make sure you've entered the real name of the problem in the Problem name. Leave the name empty if the problem has no name in this language. Then click the big button on the top that reads "Select problem files and analyze problem". In the dialog box, select all the files that are relevant to the problem: tests, checker, solutions. You can select a little bit too much, that's not a problem. Usually you can just select the entire directory with the problem (if it is in a separate directory.) Click OK.
Then the magic begins. Using the modified code from http://codeforces.ru/blog/entry/1637, the application determines which files are tests, and which ones are solutions, it determines the checker. Then the first test, the solutions and the checker (if there is any) are sent for analysis to Codeforces. There the received data are checked.
- The compilers are sorted, taking the extension into consideration, the compiler is by the compiler for each source. Free Pascal is here more preferable over Delphi and GNU g++ is more preferable over the Microsoft Visual Studio C++. If you cannot compile the source, then the necessary resources are automatically determined for it. Besides, if it is necessary, the code will be modificated. For example, it is possible that the old solution in C++ cannot compile because of wrong includes, then the 'includes' will be added automatically.
- The magic continues. For each solution the input-output file is determined automatically. The system supports stdin/stdout, input.txt/output.txt, *.in/*.out, and their combinations. For all solutions input-output files' names must match.
- Next, each solution is tested on the first test. The return code 0 is expected from the checker. The comparison is performed by words, ignoring spaces or new lines if the checker is not specified.
- If all goes well, the checker runs on the test and on the response to the test regarding it as the solution output. Of course, an OK is expected (i.e., the return code 0).
- The final touch. We have to verify that the checker actually can print something besides OK. It runs on the first test and on a random string as the output solution. In this case, the expected verdict is WA (i.e., the return code 1 or 2).
- Thus, all the points are completed. You can believe that the specified files are really similar to the solutions. They correspond to the tests. The checker looks like the checker. The processed data (possibly modified source texts + resources such as testlib.h) go back into Codeforces Contest Wizard.
The process of content analysis of the problem either ends with an error, then you need to correct something and click "Reanalyze problem", or you can move on. In the process of correction you can edit the results of auto-detecting file types, you can add or delete files and do other things. Sometimes the archive contains the deliberately wrong decisions attached. They do not pass even the first test: the easiest fix is simply excluding such decisions manually.
The "Attachments" tab
Everything is easier here. You should add statement files and additional materials. It is recommended to add the statements as a single file containing the texts of all problems (e.g., PDF or DOC). If the statements are sorted into several files, I usually compile a new DOC file with a full problem set. Always try to number the pages in the statements, add a header with the contest name.
You can select one or more files as statements. In the first case it will simply be added as it is and in the second case the files will be automatically packed in a ZIP-archive. The language must be indicated.
In the "Resources" section add various files that are related to the contest and that may be useful. For example, it may be the tutorials, some slides, test visualizers, statement sources and so on.
Finally, the "Package" tab
We are almost finishing, let's click the "Package" button. The system automatically validates all problems (see "Problems' tabs") and, if everything goes well, the system suggests to save the contest package. The most convenient way is to add it automatically directly to Codeforces. In this case, the system will open the FTP-connection and copy the contest.zip file to the folder contest root. There this file will be automatically (yes, sheer magic again) unzipped.
You can save the file locally if you want and check everything out: indicate the name with the .zip extension. Later this file called contest.zip can be added to Codeforces via FTP, but manually.
Of course, it's easier to a file to Codeforces automatically and enjoy this nice text.
Let's go back to Codeforces
The contest interface has an important link "Refresh contest". The thing is, all the changes that you can make and where the Codeforces Contest Wizard adds the data is a sandbox. To refresh the contest state by the current state of the sandbox, just click "Refresh Contest". It's not a big deal for large contests as Codeforces yet again validates everything it can get its hand on, to minimize the possibility of error. In addition, the contest adds ghost teams: After a few dozens of seconds of waiting you will be informed that the competition has been updated. You may see an error message - read it carefully and try to understand what the problem is. Probably something is wrong with the contest files.
At any time you log in go via FTP (using the Codeforces handle and password) and update some files manually. Note that for all descriptors the UTF-8 encoding is used, so save the data only in it. If you edit something manually, be highly careful and cautious. Having refreshed the contest state you will see that the problem list has been updated and the results are now supplemented by such merry ghosts.
We are a minute away from the end of the training. All that's left is sending all original solutions to the system and set time and memory limits. Do you think it's terribly boring to send original solutions? If the contest has 10 problems, and 3-6 original solutions per problem, that makes 30-60 files to send. No! It's absolutely easy! Go to the "Administration" section, click "Send all original solutions" and enjoy the result in "My submissions".
The last detail is setting limits. Either use the problem editing form or set time limits directly from the "My attempts" page using the time that some original solutions needs. In this case, the time limit is calculated by the formula RoundUp(3*T), where T is the solution time, and RoundUp is the function of rounding up to an integer number of seconds. We believe that this is a good heuristic to set the time limit. It is often even better to set a larger value, but it is highly not recommended to set a smaller one. Thus, preparing a contest is over. You can switch its access level to "protected" and show it to other coaches. If everything is well, you can open it and make it public. To inform the public about the new training session, you can write a post entitled the same as the prepared contest.
In conclusion I want to add that this is not even a beta yet, but we will do our best to quickly make the system really convenient and useful. We have done much to bring magic to Codeforces, to make the process of preparing a training session simple and reliable. I hope you will appreciate it. Please do not post specific bugs or feature requests here in comments. We will soon have a special post to report bugs and feature requests, please leave your comments there. Here is the place to arrange a general discussion of the system.
P.S. A little later I will add some screenshots to the text; it will be fun.
Wish you successful training,