Later you'll be introduced to the rules of the Codeforces contests, which differ from those of ACM-ICPC, TopCoder, GCJ, and I hope they'll bring some difference to the world of programming competitions. Most of the official competitions will be carried out according to these rules, though there will be more traditional contests. For example, Codeforces Beta Round #1 will be carried out according to the familiar ACM-ICPC rules. For some time testing will be based on Windows, but things might change in future, fortunately, the system supports testing on different platforms, even within one contest.
At the present time the system is configured to support the following programming languages (the compilation and/or the launching line is shown for each language):
- GNU C++ 4
g++.exe -fno-asm -lm -s -x c++ -Wl,--stack=268435456 -O2 -o %name%.exe %1g++.exe -static -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE -lm -s -x c++ -Wl,--stack=268435456 -O2 -o %name%.exe %1
- GNU C 4
gcc.exe -fno-asm -lm -s -x c++ -Wl,--stack=268435456 -O2 -o %name%.exe %1
gcc.exe -static -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE -fno-asm -lm -s -Wl,--stack=268435456 -O2 -o %name%.exe %1
- MS VS C++ 2005
cl /W4 /F268435456 /EHsc /O2 %1cl /W4 /F268435456 /EHsc /O2 /DONLINE_JUDGE %1
- Free Pascal 2
fpc.exe -So -XS %1 -o%~n1.exe
fpc.exe -dONLINE_JUDGE -So -XS %1 -o%name%.exe
- Delphi 7
dcc32 -cc %1
dcc32 -Q -DONLINE_JUDGE -cc %1
- C# Mono 2.6
gmcs -define:ONLINE_JUDGE -o+ -out:%name%.mono-exe %1
- Java 6
javac -cp ".;*" %1 и java.exe -Xmx256M -jar %s
javac -cp ".;*" %1
и
java.exe -Xmx256M -DONLINE_JUDGE=true -Duser.language=en -Duser.region=US -Duser.variant=US -jar %s
- Ruby 1.9
ruby.exe %s
- Python 2.7
python.exe %s
python.exe -O %s
- PHP 5.3
php.exe -n -d display_errors=Off -d error_reporting=0 %s
php.exe -n -d ONLINE_JUDGE=true -d display_errors=Off -d error_reporting=0 %s - Haskell GHC 6.12
ghc --make -O %s - F# 2.0
fsc.exe --define:ONLINE_JUDGE --optimize+ %s - OCaml
ocamlopt nums.cmxa str.cmxa -pp camlp4o -unsafe -o %name%.exe-ocaml %1 - Scala
As Java
It is not guaranteed that all the problems will have solutions in all the given languages (it's especially about the scripting ones). Probably, I'll later introduce equalizing coefficients for the working time for some languages. A "plus" next to the version name means that the testing system can use older versions. If you have suggestions about the possible ways to change the compilation or the launching line, write about them in your commentaries.
It should be mentioned that apart from standard verdicts, you can get "Denial of judgement", which usually means that your solution can't be launched, or it has unexpectedly failed. For example, is the Delphi array is too big, the compiler compiles the code, but the result will be the incorrect win32 exe-file. Solutions with the verdicts like "Compilation failed", "Denial of judgement", "Judgement failed" will be ignored while summing the results.
Moreover, pay attention, please, that the problems will be given in English as well as in Russian.
That's it, see you at Codeforces Beta Round#1.
UPD: GCC compiler has been added.
UPD 2: Added Haskell and F#.
UPD 3 (December, 18, 2011): Actual compiler versions are
- GNU C/C++: 4.6.1
- Microsoft Visual Studio C++ 2005
- C#: Mono 2.10.2
- Free Pascal: 2.4.4
- Delphi 7
- Java: 1.6.0_29 (JRE обновляется автоматически)
- Ruby: 1.9.3
- Python: 2.7.2
- Haskell: 6.12.2
- OCaml: 3.12.1
- Scala: 2.9.1
- PHP: 5.3.8








And why C++ and C are compiled in the exact same way?
to increase stack space size, you just have to pass "RTS" switches to executable file, leaving compiling command line unchanged.
compile: ghc --make -O program.hs
running: program.exe +RTS -K256m -A8m -RTS
here -Ksize sets the maximum stack space size, the default value is 8mb, it's not reserved memory space, and won't affect overall performance.
and -Asize sets the cache size of GC, it's a reserved space to speed up GC, the default value is 128k, and quite small for data structure problems here (via profiling I found my program spends more than 80% of running time on GC when solving a standard data structure problem here).
on *nix, it's simple, and you can leave the judge system setting untouched.
export GHCRTS="-K256m -A8m"
I guess it's also quite easy on Windows.
I don't know to whom should I request the same.
http://codeforces.com/blog/entry/405
It runs on the JVM so you could download the clojure.jar and clojure-contrib.jar jars (Clojure 1.1 is the current version) and run programs with
java.exe -classpath "clojure-contrib.jar;clojure.jar" clojure.main %1
I will help test it if you like.
It would be a lot more fun for me and other Clojure programmers. There were twice as many of us who qualified for GCJ this year as there were F# programmers.
Though we should note that after adding python and other interpreted languages we may expect complains that interpreters are not fast enough, while time limits are the same for them and for C-programmers.
Is it possible to change the C# compiler to using dmcs.exe so that we can write C# 4.0 code?
According to this page: http://mono-project.com/CSharp_Compiler, the gmcs compiler only targets the 2.0 runtime.
-Wall --pedantic
And my gcc (gcc version 4.4.5 (Debian 4.4.5-8)) not give any errors. But when I posted my program here (on GNU C) it says "Runtime error on test 1".
Program works correctly and take right answers. You can see code here: http://pastebin.com/jhec4ixB
Thanks for your attention.
And C# mono is much slower that csc.It is even slower than java(by a 2x factor)
many other programming sites provides both versions...
ocamloptis used (which I suppose it should be.) Anyway, thanks for adding OCaml.This problem has a solution on Python consumed 60 ms and 3100 KB. I think it is possibly to solve it on Ruby. Anyway we do not guarantee that any problem has a solution on languages like Perl/PHP/Python/Ruby.
Why is
-fno-optimize-sibling-callswhich disables tail call optimization passed to GCC? I’ve always assumed during the contests that GCC does TCO, so I’m a bit confused.Because we found that sometimes this optimization makes code to be invalid.
You use version 4.6.1 — this bug already fixed in this version.
It would be nice if you could add the Go programming language. They are close to finalizing the first stable version (Go 1). The latest weekly release is RC1.
http://weekly.golang.org/
http://code.google.com/p/go/downloads/list
The syntax and standard library API are mostly fixed; there are a few remaining implementation bugs but it is already generally very stable and usable.