Codeforces Là Gì


# User Contrib.
1 YouKn0wWho 195
2 awoo 192
3 -is-this-fft- 189
4 Monogon 188
5 Um_nik 184
6 antontrygubO_o 169
7 maroonrk 167
8 kostka 166
9 Errichto 165
10 SlavicG 163

ByMikeMirzayanov, 10 years ago, translation,

This is a detailed và formal version of the conchạy thử rules. If you just want to learn the rules, we recommover that you first read the post Contests. The organizers may slightly modify the rules for specific rounds, then this information is contained in the announcement of the round. The following rules should be regarded as default rules.

Bạn đang xem: Codeforces là gì

General information about a round

You need khổng lồ register to participate in a round. The registration opens six hours before the start of the conchạy thử & closes 5 minutes before it, unless the information about the round states otherwise.

The system of conducting contests has two interface languages available: Russian and English. The contestants can switch between these two languages.

A round continues for 2 hours, unless the information about the round states other duration time.

Contestants are given 5 problems lớn solve sầu, unless the information about the round states another number of problems.

Problem statements are available in two languages: Russian & English

Statements of all problems become available khổng lồ read at the moment the round starts.

Before the conkiểm tra begins, all registered contestants are randomly split inkhổng lồ rooms. Each room contains about 40 contestants.


During a conchạy thử the contestants can ask questions to lớn the contest jury via the system. The questions may concern mistakes, ambiguous spots and inaccuracies in the statement.

A question must be asked in one of two languages: Russian or English. The question must be clear và written in a correct language. Otherwise, the jury preserves the right not to consider the question và answer "no comments".

The conthử nghiệm jury can answer the given question in an arbitrary text form.

The answer No comments means that the question either doesn"t the requirements listed in point 2 or the answer to lớn the question is in the statement or in the condemo rules.

An answer to lớn a question is only available lớn the contestant who has asked it apart from the cases when the conthử nghiệm jury decides that the question is important for all contestants. In this case the jury can make the question & the answer lớn it available to all contestants.

Problem Solution

A problem solution is a program written in one of the following programming languages (different problems can be solved in different programming languages, the list of languages can be widened):

С/С++ Delphi/Pascal Java С# Pythuôn Ruby PHP OCaml Haskell Perl Scala D Go

Requirements to the solutions:

The full program should be contained in a single tệp tin. If the problem statement doesn"t specify the names of input đầu vào or output, you must read the data from the standard input đầu vào & write it khổng lồ the standard output. You are forbidden to work with the Net. You are forbidden to perkhung input-output operations except for opening, closing, reading và writing files & standard streams given in the problem statements to perform input-output. You are forbidden to run other programs và create processes. You are forbidden khổng lồ modify files or directories" permissions in the file system. You are forbidden to lớn work with directories other than the current one. You are forbidden to work with the operating system registry. You are forbidden to lớn create & use GUI elements (windows, dialogs etc.) You are forbidden to work with external devices. You are forbidden to lớn perform any other actions that can in any manner destabilize the judging process.

After a contestant solves a problem, he submits the solution via the conchạy thử system interface và continues working on other problems. After the system receives & judges a solution, it immediately responses by displaying the result of judging the solution.

A contestant can see the results of judging of his solutions on the corresponding tab of the conchạy thử system. During a contest a contestant can see the results of only his solutions" judging.

Compiling solutions

As a contestant submits a solution, he chooses a compiler that the judging system should use as it compiles the program. The judging system uses the following compilers for judging (the jury has the right to lớn add other compilers at its discretion or replace the compiler"s versions with the newer ones):

MinGW GNU C++ 4 MinGW GNU C 4 MS VS C++ 2010 Free Pascal 2 Delphi 7 C# Mono 2 Java 6, 7 Ruby 1 Python thả 2 PHP 5 Haskell GHC 6 Objective Caml 3 Scala 2 Perl 5 MS C# .NET 4

The contest organizers are not responsible for problems caused by the compiler"s version in the judging system not matching the compiler"s version used by the contestant as he was writing the program. To partially avoid such problems, there is an option khổng lồ run a contestant"s code on the server"s side. To run the code, the contestant should submit the program and the input đầu vào lớn the VPS. After a while the judging system will display the result of the program"s execution và the output.

Solutions are compiled & run under Windows OS. Line breaks are set by a couple of symbols #13#10. A file"s or an input"s last line should over with a line break (right before the kết thúc of the file).

If a compilation error occurs, than the contestant gets the judging result as "Compilation error" & the compilation log.

The kích cỡ of the tệp tin with the source code shouldn"t exceed 64 kilobytes.

The judging system uses command line compilers khổng lồ compile solutions. The compiler commvà lines for different compilers are given in the table:

Compiler compilation (execution) commvà line
GNU C++ 4 g++.exe cộ -static -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE -lm -s -x c++ -Wl,--stack=268435456 -O2 -o %name%.exe pháo %1
GNU C 4 gcc.exe cộ -static -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE -fno-asm -lm -s -Wl,--stack=268435456 -O2 -o %name%.exe pháo %1
GNU C++ 4 (C++0x) g++.exe -static -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE -lm -s -x c++ -Wl,--stack=268435456 -O2 -std=c++0x -D__USE_MINGW_ANSI_STDIO=0 -o %name%.exe cộ %1
MS VS C++ 2010 cl /W4 /F268435456 /EHsc /O2 /DONLINE_JUDGE %1
Free Pascal 2 fpc -n -O2 -Xs -Sgic -viwn -dONLINE_JUDGE -Cs67107839 -Mdelphi -XS %1 -o%name%.exe
Delphi 7 dcc32 -Q -$M1048576,67107839 -DONLINE_JUDGE -cc %1
C# Mono 2 dmcs -define:ONLINE_JUDGE -o+ -out:%name% %1
Java 6,7 javac -cp ".;*" %1, java.exe cộ -javaagent:invokeagent.jar -Xmx512M -Xss64M -DONLINE_JUDGE=true -Duser.language=en -Duser.region=US -Duser.variant=US -jar %s
Ruby 1 ruby.exe -c %1
Python thả 2 pykhiêm tốn -c "compile(open("%1").read(), "%1", "exec")"
PHP 5 php.exe pháo -l %1
Haskell GHC 6 ghc --make -O -o %name% %1
OCaml 3 ocamlopt nums.cmxa str.cmxa -pp camlp4o -unsafe -o %name%.exe-ocaml %1
Scala 2 См. Java
Perl perl.exe pháo %s
D dmd -L/STACK:268435456 -version=ONLINE_JUDGE -O %s
Go go build %1

Judging Solutions

During the conchạy thử the solutions are judged on a small number of tests called pretests.

The result of judging the solution on the pretests are displayed to the contestant right after the judging.

Each kiểm tra is represented by the input for the contestant"s program. The limits for the input contained in the chạy thử are indicated in the problem statement.

All problems indicate the maximum time a program can take to work on one thử nghiệm and the maximum memory that can be consumed.

Judging is performed by consecutively running the program on each test.

The test is considered passed if running the program terminated with the return code 0, the process fit into the given time & memory limits and besides, the program printed the correct answer to the given demo. The table below gives the most frequent verdicts of possible errors.

Judgement Verdict Description
Memory limit exceeded The program tries lớn consume more memory than is indicated in the problem statement
Time limit exceeded The program hadn"t terminated in time indicated in the problem statement
Runtime error The program terminated with a non-zero return code (possible reasons: array out of bound error, division by zero, staông chồng overflow, incorrect pointers usage, etc)
Wrong answer Wrong answer
Idleness limit exceeded The program didn"t use the CPU time for considerable time
Denial of judgement The solution was impossible to run, perhaps, due to lớn a judging error. The most probable cause is an error in the program (for example, using extra large arrays)

If the solution passed all pretests, the contestant is displayed the result that says Pretests passed. Otherwise, the contestant is displayed the judging result as the number of the first prethử nghiệm that failed the judging and the judging system verdict.

If the result of the judging is Compilation Error, Denial of judgement (or similar) or if the solution didn"t pass the first prethử nghiệm, then this solution won"t be considered in calculating results.

Xem thêm: Chiến Thuật Giả Lập Xếp Hạng Fifa Online 3 Mới Nhất 2017 Glxh Fifa Online 3

The solution of one problem can be submitted multiple times.

The solution that passes all pretests is considered the contestant"s verified solution for this problem.

If a contestant submits several times a problem"s solution that passes all pretests, then the last solution is considered as the contestant"s verified solution for this problem. All other solutions will be considered as unsuccessful attempts.

If a contestant"s solution passes all pretests, the problem is considered pre-solved by the contestant and the system calculates the contestant"s preliminary points for the given problem. The points are calculated by the following scheme:

each minute decreases the problem"s value: the value decreases by X/250 points per minute (where X is a problem"s initial value), for example, a problem with the initial value of 500 points gets 2 points cheaper every minute; the number of points a contestant gets for a problem equals the current value of the problem in points minus penalty; the penalty is determined as the number of this contestant"s previous solutions for this problem, multiplied by 50 points; a contestant can"t earn less points than 30% of the initial problem value.


A contestant can lochồng any of his pre-solved problems. That means that the contestant loses the right to submit solutions for this problem.

After the contestant locks a problem, he gets the right khổng lồ view the original codes of submitted solutions of other contestants for this problem that nói qua the same room with him. Having viewed another person"s code, the contestant can suggest a thử nghiệm on which, as he thinks, the given solution will fail. This procedure will be further called a solution"s haông chồng. A test can be given manually or using a generator program that writes the chạy thử to lớn the standard output. The system automatically validates the chạy thử lớn satisfy problem statement constraints. If it doesn"t, the contestant is notified about it và the hachồng attempt is ignored. If the kiểm tra satisfies the indicated constraints, then the solution runs on the offered demo. If the solution doesn"t pass the demo, then the haông xã is considered successful, otherwise it is considered unsuccessful. A hack attempt is also ignored if by the given moment the hacked solution is not the contestants" last verified solution of the problem. For example, this might be the case if sometoàn thân already hacked the given solution before or the hacked contestant has resubmitted the solution.

A contestant gets 100 points for a successful hachồng & a penalty of 50 points for an unsuccessful haông chồng.

If a contestant"s solution is successfully hacked, then happens the following:

he problem isn"t considered pre-solved by this contestant anymore his preliminary points for this problem are remix khổng lồ 0 the chạy thử from the haông chồng is added to this problems" prechạy thử set for the given contestant

If a contestant locked a problem, but had the solution hacked, then he preserves the right khổng lồ haông xã other people"s solutions for this problem.

Can-do"s & Can"t-do"s

During the round the contestants are allowed to lớn use any books & personal notes as well as a code written beforehvà by you personally.

It is allowed to lớn use any sources of information on the Internet (but it is forbidden to lớn copy-paste somebody toàn thân else"s code).

It is forbidden to obfuscate the solution code as well as create obstacles for its reading & understanding. That is, it is forbidden to use any special techniques aimed at making the code difficult khổng lồ read và understand the principle of its work.

The contestants are forbidden khổng lồ talk about subjects, related to the problems, with anybody, including other contestants. It is only allowed to ask questions lớn the jury via the system (see the "Questions" section).

The organizers of the contests have sầu the right to lớn monitor the contestants" honesty in behavior using different methods & disqualify the contestant if violations are found.

All programs submitted by the contestants for judging, should be aimed at solving the problem and not at violating rules or destabilizing the judging system. A contestant who deliberately attempts to lớn destabilize the judging system, will be disqualified.

Attempting lớn digitally extract other contestant"s code during the hacking is considered cheating. You may not use any technical/digital tools lớn obtain other contestant"s code, including (but not limited) OCR, traffic capture, browsers plugins and so on. The only allowed method to lớn analyze other contestant"s solution is reading it in a hacking window. However it is allowed lớn manually retype the solution or it"s parts to run it locally.

Any violation of these rules, rules from the FAQ section, rules from the conkiểm tra announcement or rules that were accepted during the registration will lead to penalty provisions, including disqualification.


During the conkiểm tra the current results" table is available khổng lồ the contestants. The table shows the current place of each contestant. The table also contains the information about the hacks and the history of submissions of each contestant.

All intermediate results are unofficial.

System Testing & Final Standings

After a condemo is over, the results of the contestants" solutions" judging on the main phối of tests are published.

The main kiểm tra mix is used khổng lồ judge verified solutions, i.e., the solutions that meet all these criteria:

passed all pretests; are the last submitted solutions of each contestant for each problem; haven"t been hacked.

A problem is considered solved by the contestant if the contestant"s solution passed all tests from the main mix of tests.

A solved problem brings khổng lồ the contestant the score, equal to lớn the pre-score of his solution for this problem.

A contestant"s result is the sum of points for all problems he has solved plus points for hacks.

In the final results" table the contestants are listed in the order or the results" decreasing. If two or more contestants have the same result, they mô tả the same place.

The judging is performed on computers Chip Core 2 Duo E6750, 2.66 Ghz, 3Gb of memory.

Intellectual property

The rules below are used each time if for a particular round there are no separate rules. Competitors retain ownership of all intellectual & industrial property rights (including moral rights) in & lớn Submissions.

Xem thêm: Mặt Nạ Nam Tước Bóng Đêm - Chỗ Mua Mặt Nạ Guy Fawkes Ở Hn

As a condition of submission, Competitor grants, its subsidiaries, agents và partner companies, a perpetual, irrevocable, worldwide, royalty-không lấy phí, & non-exclusive sầu license khổng lồ use, reproduce, adapt, modify, publish, distribute, publicly perform, create a derivative work from, & publicly display the Submission.

Contestants provide submissions on an "as is" basis, without warranties or conditions of any kind, either express or implied, including, without limitation, any warranties or conditions of title, non-infringement, merchantability, or fitness for a particular purpose.