MikeMirzayanov's blog

By MikeMirzayanov, 15 years ago, translation, In English

This post is no longer relevant; it has become significantly outdated. You should read the post at https://codeforces.me/blog/entry/121114.

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):

  1. GNU C++ 4
    g++.exe -static -DONLINE_JUDGE -lm -s -x c++ -Wl,--stack=268435456 -O2 -o {filename}.exe {file}

  2. GNU C++11 4
    g++.exe -static -DONLINE_JUDGE -lm -s -x c++ -Wl,--stack=268435456 -O2 -std=c++11 -D__USE_MINGW_ANSI_STDIO=0 -o {filename}.exe {file}

  3. GNU C 4
    gcc.exe -static -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE -fno-asm -lm -s -Wl,--stack=268435456 -O2 -o {filename}.exe {file}

  4. MS VS C++
    cl /W4 /F268435456 /EHsc /O2 /DONLINE_JUDGE {file}

  5. Free Pascal 2
    -n -O2 -Xs -Sgic -viwn -dONLINE_JUDGE -Cs67107839 -Mdelphi -XS {file} -o{filename}.exe

  6. Delphi 7
    dcc32 -Q -$M1048576,67107839 -DONLINE_JUDGE -cc {file}

  7. C# Mono 2
    dmcs -define:ONLINE_JUDGE -o+ -out:{filename}.exe {file}

  8. C# .NET
    csc.exe /o+ /d:ONLINE_JUDGE /r:System.Numerics.dll /out:{filename}.exe {file}

  9. Java 6, 7
    javac -cp ".;*" {file}
    и
    java.exe -Xmx512M -Xss64M -DONLINE_JUDGE=true -Duser.language=en -Duser.region=US -Duser.variant=US -jar %s

  10. Ruby
    ruby.exe %s

  11. Python 2, Python 3
    python.exe %s

  12. PHP 5
    php.exe -n -d ONLINE_JUDGE=true -d display_errors=Off -d error_reporting=0 %s

  13. Haskell GHC 7
    ghc --make -O %s

  14. D
    dmd -L/STACK:268435456 -version=ONLINE_JUDGE -O -release -inline -noboundscheck {file}

  15. OCaml
    ocamlopt nums.cmxa str.cmxa -pp camlp4o -unsafe -o {filename}.exe-ocaml {file}

  16. Scala
    As Java

  17. JavaScript V8
    d8 {file}

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.2: Actual compiler versions are

  • Mono C# compiler version 3.2.3
  • DMD32 D Compiler v2.064.2
  • Delphi 7 [Borland Delphi Version 15.0]
  • Free Pascal Compiler version 2.6.2
  • MinGW g++.exe (GCC) 4.9.2
  • Haskell Glorious Glasgow, version 7.6.1
  • Java 6 javac 1.6.0_45
  • Java 7 javac 1.7.0_72
  • Java 8 javac 1.8.0_25
  • Ocaml ocamlopt 4.00.1
  • Perl v5.12.2
  • PHP 5.3.8
  • Python 2.7.8
  • Python 3.4.1
  • Ruby 2.0.0p353
  • Scala compiler version 2.11.1
  • MS VS C++ 2010
  • JavaScript V8 3.23.0
  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
15 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I'm not sure that the Python interpreter is actually 2.6. I get runtime error every time I try to import the collections module. Could you please look into the matter? Thanks.
15 years ago, # |
  Vote: I like it 0 Vote: I do not like it
There are so many switches, which are passed to GNU C++ 4 compiler. Is there any page, which describes what each one of them does?

And why C++ and C are compiled in the exact same way?
15 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Mike, you've said that you are going to install Haskell. It is a very good intention, but I (and I think many others) would appreciate adding F# also (see http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/release.aspx , there are F# packages for many platforms). With the come of Visual Studio 2010 F# becomes accessible better than Haskell I think. What do you think about it?
  • 14 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Done
    • 9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Got this error when 2-minutes were left in the contest #339::Div2::C I thought "M_PI" was standard in "G++11" /--------------------------------------------------------------------/ Can't compile file: program.cpp: In function 'int main()':

      program.cpp:191:10: error: 'M_PI' was not declared in this scope

      ans=ans*M_PI; ^ /--------------------------------------------------------------------/ Submission Link http://codeforces.me/contest/614/submission/15372460

14 years ago, # |
  Vote: I like it +15 Vote: I do not like it
I suggest to use "ghc --make -O %s". This will allow GHC to resolve package dependencies.
At the moment, importing "Data.Map" produces compile error, because Map is in containers package.

  • 14 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Fixed, thank you!
    • 14 years ago, # ^ |
        Vote: I like it +12 Vote: I do not like it
      "There are plans to add Haskell." may be removed
    • 14 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it
      The default stack size in ghc is 8mb, it's too small to fit some algorithm problems require like 100k levels recursion. So is there any chance to increase this limit to like 256mb(like default setting of g++ here)?

      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).
      • 14 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        If you feel it's difficult to set the running params, you can set the environment variable as well.
        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.
    • 10 years ago, # ^ |
        Vote: I like it +11 Vote: I do not like it

      same issue as bjin. the stack size of Haskell is too small to solve many large-scale-data problems.

      could u pls make it larger?

      • 4 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Has this ever been addressed? Is Haskell still run with a very low stack size?

14 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Why Perl is not allowed ?
I don't know to whom should I request the same.
14 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I would also like you to see this
http://codeforces.me/blog/entry/405
14 years ago, # |
  Vote: I like it +3 Vote: I do not like it
Could we possibly have Clojure added to the languages? 

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.
  • 14 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    That would be great.
  • 14 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    While only Clojure? What about Scala?
  • 13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    +1 for last Google AI Challenge was won by LISP-written bot.

    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.
14 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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. 

14 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Using the vector package, I was able to speed up a Haskell solution of the CF25-C from 12 sec. to 1 sec. Unfortunately, the package is not installed on the server. Since the package optimizes array operations, it would allow to solve many DP-like problems in Haskell.

May I ask to install it? There are two steps:
1) Download/install the package manager (cabal.exe or cabal-install.tar.gz).
2) run "cabal install vector" under the "judge" user account.
My solution of the CF25-C can be used for testing.

It would also be nice to have parser-combinators and regular expressions (but not that important):
cabal install parsec
cabal install regex-posix

14 years ago, # |
  Vote: I like it 0 Vote: I do not like it
i dont understand how to check and what does it mean by 
cl /W4 /F268435456 /EHsc /O2 /DONLINE_JUDGE %1

i used codeblock software and 1st time i submitted by selecting GNU C++ as i did before, but i got WA, then i select MS C++, bt also got WA... then what compiler i will select? :'(
  • 14 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it
    Rather than switching compilers, why not fix your solution? Do you understand what WA means?
14 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Hello. I have some problems with a compiler. I use Linux and solve some problems of Codeforces Beta Round #65 (Div.2). I compile my programs with keys:
-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.
  • 14 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    What is "long_words.txt"? You must read from standard input.
14 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Isn't there any chance that you add csc compiler,.Net compiler, for C#?I observe that  you already use .Net for F#.
And C# mono is much slower that csc.It is even slower than java(by a 2x factor)
14 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Is it possible to change the judge such that it supports %lld? I did not understand what's wrong with my solutions at the last contest and only realised the error at the last minute :(
  • 14 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    AFAIK,%lld is available with MS VC++.
    It isn't  available with g++, because it is MinGW g++,which not support this identificator
13 years ago, # |
  Vote: I like it +5 Vote: I do not like it
Please update Python 2.5 to Python 3.2.....
many other programming sites provides both versions...
  • 13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    If you want that, press here to the green button .
  • 13 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it
    I would also appreciate it if Python3.x is available.
    I learnt Python with its 3.0 and 3.1 releases. They did some significant changes (including the syntax) from 2.x to 3.x but the 2.x version remains popular. (And I think that's why officially Python is still maintaining and offering both 2.x (latest 2.7) and 3.x (latest 3.2) at the same time).

    I guess it won't hurt to provide both on codeforces, like KK123 said, there are also some other programming practice sites doing that.
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
In java 6 do i have to write a particular class name for a problem
13 years ago, # |
  Vote: I like it +1 Vote: I do not like it
Could you give the detail about the compiler used to compile (newly-added) OCaml?  I'd like to know if the optimizing compiler ocamlopt is used (which I suppose it should be.)  Anyway, thanks for adding OCaml.
»
13 years ago, # |
  Vote: I like it +12 Vote: I do not like it
Update to Java 7?
  • »
    »
    13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    It will be soon, not as update but as a separate language for now. Also we have desire to use it in production. Do you have such experience?
    • »
      »
      »
      13 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Not yet. Only played on small-scale problems with it so far.
»
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Is there any possibility to increase time limits for such problems, which impossible to solve in Ruby due to large input data (test 28 for instance)?
Thanks.
  • »
    »
    13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

»
13 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Why is -fno-optimize-sibling-calls which disables tail call optimization passed to GCC? I've always assumed during the contests that GCC does TCO, so I'm a bit confused.

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

i think "special languages" should not be disabled for those "normal problems"... also, some of normal problems are not so hard for esoteric languages to solve...

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there any plans to allow some versions of Lisp in contests? Common Lisp / Racket

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +12 Vote: I do not like it

    Please, not until I do a Surprise Language Round for it :-)

»
12 years ago, # |
  Vote: I like it +1 Vote: I do not like it

I think Java should have larger stack size. Default stack size is too strict for some problems. Stack size can be changed with -Xss option.

  • »
    »
    12 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I agree, it should not be hard. For now it's possible to create a new Thread and specify the stack size in Thread's constructor.

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I submitted a code in Java,But I get the following error

Source should satisfy regex [^{}]*public\s+class\s+(\w+).*

What does this mean???

  • »
    »
    12 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It should contain public class SomeName before any '{' or '}'

    or something like this. Can yo give link to the submission ?

»
12 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Could you add the mtl package for Haskell to use the very useful Monad Transformer and State Monad

Thanks

»
12 years ago, # |
  Vote: I like it -8 Vote: I do not like it

Will Python 3.x will be supported? You could add it as a separate language, it's not neccessary to replace python 2.x. I think it's not hard to add it at all...

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I don't see an F# option when submitting solutions. Help?

  • »
    »
    12 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    There are several discussions about it in this thread in Russian "view" (which you can read, though poorly, via google translate, I think). It looks like F# compiler have technical or some other problems and it was disabled for an unknown period of time...

»
12 years ago, # |
  Vote: I like it +17 Vote: I do not like it

Could you please upgrade GHC to the latest release (7.6.1)?

There are significant improvements comparing to the current one used in codeforces. It contains newer libraries which providing more powerful apis, provides new features and generates faster programs. These will make people using Haskell be able to challenge more complicated problems.

  • »
    »
    12 years ago, # ^ |
    Rev. 5   Vote: I like it +17 Vote: I do not like it

    I also agree on replacing the outdated GHC6 with GHC7.

    Instead of upgrading to GHC 7.6 directly, I suggest Codeforces to install Haskell-Platform 2012.4.0.0, which is more stable and well supported in many aspects. It contains GHC 7.4 and some new packages like vector, which makes Haskell competitive to imperative languages like C++ and Java in some problems.

    The LLVM backend is now stable in GHC7.4, and with -fllvm flags it will be enabled.

    I use ByteString state monad to parse input in haskell codes, Unfortunately, mtl package is not shipped with GHC (but included in haskell platform), so I have to paste a very long (like 50 lines?) piece of code implementing a very simple state monad each time.

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

May i know if this g++.exe -static -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE -lm -s -x c++ -Wl,--stack=268435456 -O2 -o %name%.exe %1 is still valid, ie. applies to GNU C++ 4.7 (currently used in programming contests held here on this site)?

»
12 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Add Go and Rust please, thank you

»
12 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

How the system compiles C++ 0x program? with -std=c++11?

  • »
    »
    12 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    -std=c++0x

    • »
      »
      »
      12 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      thanks

    • »
      »
      »
      12 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      Maybe it should be changed to -std=gnu++0x for consistency? After all, GNU extensions are enabled when compiling in default mode (the command line for "GNU C++ 4" will implicitly use -std=gnu++98).

    • »
      »
      »
      12 years ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      Please make it -std=c++11

    • »
      »
      »
      12 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      It seems the compiler haven't enable -std=c++0x, for example here is my code for http://www.codeforces.com/contest/218/problem/A, in which I used 'auto' to declare a variable:

      #include <iostream>
      #include <string>
      #include <algorithm>
      #include <cmath>
      #include <map>
      #include <set>
      using namespace std;
      
      const int N = 1000;
      
      int main() {
      	auto n = 0,k = 0;
      	cin>>n>>k;
      
      	auto a = new int[2*n+1];
      
      	for(int i=0;i<=2*n;i++) {
      		cin>>a[i];
      	}
      
      	for(int i=0;i<=2*n;i++) {
      		if(k && i%2==1 && a[i]-a[i-1]>1 && a[i]-a[i+1]>1) {
      			a[i]--;
      			k--;
      		}
      		cout<<a[i]<<' ';
      	}
      	return 0;
      }
      
»
12 years ago, # |
  Vote: I like it +8 Vote: I do not like it

In the past two contests, I met a problem with Perl. Such as these submissions.

http://codeforces.me/contest/266/submission/2991670 http://codeforces.me/contest/268/submission/3021653 http://codeforces.me/contest/268/submission/3022677 http://codeforces.me/contest/268/submission/3025426

The programs passes some test cases, but got a "Idleness limit exceeded" on some other cases. Could anyone help me with this problem?

»
12 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Is it possible to know why we can't use import collections in our Python code?

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Well, probably many people write things like that and it may be annoying but... I think that scheme/lisp is a really nice language and that it would be nice to have the possibility to submit code in it. It is quite unique compared to other languages.

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

As I am taking an assembly language course, I found it hard to find problems to practice. I think it will be great if CF add a assembly compiler to the system so we can use some simple problem to improve our assembly programming skills.

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Sorry for repeating, but I think it's a right time to finally add Python 3. It would be really nice from your side.

»
12 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Mike, could you please add GCC C99 build target? It's so sweet to have variables in the middle of the scope and in for loop. Just gcc -std=c99. Or even update GNU C to support C99 — this shouldn't break existing C89 programs, while some people may take advantage of C99. Note you have C++11 as separate target.

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Maybe -std=gnu99 would be better as it also provides the GNU extensions

»
11 years ago, # |
  Vote: I like it +5 Vote: I do not like it

I would like to +1 to numerous requests in this thread about missing Haskell libraries. Here is a list of the most important ones, in my opinion:

vector — provides Vector data type. Reference: 'Use this package whenever you'd use an array in another language'

unordered-containers — provides HashMap and HashSet data types.

mtl — provides Control.Monad.State, Control.Monad.Reader and others. Crucial for writing stateful code, without them it feels like part of the language is missing.

These are really the most basic packages and IMHO shouldn't be missing. (How would you feel about exclusion of std::vector from C++?) It would be great if at least these packages were installed but it's really simpler to just install Haskell Platform.

»
11 years ago, # |
  Vote: I like it 0 Vote: I do not like it

About Ruby. Ruby has no built-in support for multi-dimensional arrays, and the workaround like Array.new(n) { Array.new(m) { 0 } } is really a pain in the ass.

I think arrays are really important to algorithm problems. So just like other guys suggested to add the 'vector' hackage to Haskell(which I'll totally vote for it), maybe a more handy version of multi-dimensional array for Ruby should be added, like 'narray'.

Here's the webpage for narray. http://narray.rubyforge.org/SPEC.en

It's pretty neat.

»
11 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Hello,

This might not be the appropriate place for my question but I don't know where else I can post.

I have submitted 2 problems and at some point, a test fails for each. The same happens when I run a custom test with the code and input. The issue is that when I run them locally, with the same set of data, the answer is the expected one. I chose GNU C 4 and locally I have GCC 4.7.3. I tried with the compile options from this page but I still have the same problem. Any ideas on this?

Thanks.

  • »
    »
    11 years ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    see this http://ideone.com/GDLpO7.

    Try to printf values after scanf (in server code runner)

    Problem is in the line with scanf

    • »
      »
      »
      11 years ago, # ^ |
        Vote: I like it +2 Vote: I do not like it

      Hello,

      Thank you for your reply. Indeed, it seems to be a problem with scanf. Any clue on how to solve this?

      Thanks.

  • »
    »
    11 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    An unsigned long is only guaranteed to be able to hold values up to 232 - 1 ≈ 4·109. Check carefully, could the result that your solutions are printing be greater than this?

»
11 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Will R-cran be supported? Topcoder have already done that.

I have compete in GCJ with R in 2012 and 2013, it was never a bottleneck. Here are some examples: https://github.com/hetong007/r4codejam

»
11 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Maybe instead of Python you can use pypy (http://pypy.org/). Its a python JIT enabled runtime and much faster than default CPython interpreter and fully compatible with standard libs. I just had a time limit exceed due to a loop of 10^6 taking 5 seconds in CPython but only 0.1 sec in PyPy due to JIT. Please, consider replacing Python with PyPy

  • »
    »
    11 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    I have just +1'ed all the posts that push PyPy. Let's add (or replace) CPython with PyPy. Example from 214: my solution to problem 3 got TLE on test 20. So I run the test with PyPy:

    $time python 3.py < 20
    1750
    
    real	0m3.343s
    user	0m3.245s
    sys	0m0.065s
    
    $time pypy 3.py < 20
    1750
    
    real	0m0.908s
    user	0m0.745s
    sys	0m0.111s
    

    (I was able to pass TLE by patching my solution, but anyway...)

    • »
      »
      »
      11 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I support that. I used PyPy for Codejam and it often gave 2-3 times speed up compared to official Python compiler.

      • »
        »
        »
        »
        10 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Yeah, PyPy should be the standard for programming contests instead of CPython. I hope they support it in the near future!

        • »
          »
          »
          »
          »
          10 years ago, # ^ |
            Vote: I like it +3 Vote: I do not like it

          support!!!

          python always got TLE

          use PyPy or extend time limit for python language

»
11 years ago, # |
  Vote: I like it 0 Vote: I do not like it

hi why your c# compiler represent '.' like ',' so I'll get "Wrong answer" result on test. thx in advance

  • »
    »
    11 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    If you mean printing numbers then it is probably because computers which test the solutions have russian locale by default. You need to print numbers in culture-independent manner (CultureInfo.InvariantCulture).

    • »
      »
      »
      11 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      I also want to complaint on this. Last contest I got 2 RE2 on my solution before I got what is the problem. Here is submits — 6072446 6072446 so... it's not to honest for participant to guess why you have runtime on server and correct answer on local PC.

»
11 years ago, # |
  Vote: I like it -8 Vote: I do not like it

c++ is my favorite language.

»
11 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Hello. Could you please describe what problems do you have with F#? What OS do you use with F#? I think that we can help deal with the problems and return it to the list of languages. Thanks.

»
11 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Any chance to get a 64-bit version of PHP? Or do I need to start using a real programming language? :)

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I never saw it mentioned anywhere in the blogs, so FWIW: I've noticed that Scala compiler has recently been upgraded to the latest and greatest (2.11.1). Whoever did this, thanks a lot.

»
10 years ago, # |
  Vote: I like it +9 Vote: I do not like it

I think codeforces has a great collection of supported languages, but most of them are from the ALGOL family. It would be really awesome if we could also have support for a Lisp. Could we possibly have support for Clojure or Common Lisp?

»
10 years ago, # |
  Vote: I like it +3 Vote: I do not like it

HI, what do you think about adding Dart language? It looks like a very cool language, and it has been recently approved and standardized by ECMA.

»
10 years ago, # |
Rev. 2   Vote: I like it -18 Vote: I do not like it

What about change python run env from cpython to pypy? Because the algorithm problems are always CPU intensive, pypy is 2-3 times faster than cpython in general.

Another solution is to extend the time limit for python, such as 5 times as cpp. For example, the time limit for java is 3 times as cpp at http://poj.org/

Because codeforces is all about algorithm problem solving, it's unfair for python programmer in the competitions.

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +26 Vote: I do not like it

    It is unfair to give one language a bigger time limit than to others. Python users already get the advantage of clean high-level syntax, data structures and language support, so they have to pay with a slower run time for this. Other, faster languages should not be handicapped just because they are better than Python in this regard.

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Thank you for ruby, go and ocaml. Closure would be great.

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Any particular reason why C# .NET references System.Numerics assembly, but Mono doesn't?

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there any particular reason for running Java with -Xmx512M -Xss64M ?

For stack size, while C++ is compiled with 256MB stack size, why Java only have 64MB?

For Xmx, I think setting it to 512M makes behaviour of codes which heavily use objects unpredictable, because garbage collector may runs only after the code already got MLE.

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    You are right, I'm planning to change it. Thanks.

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      When you are at it, please remember to do the same stack increase for Scala solutions as well. Thank you in advance.

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I did not see the "GNU C++ 11" in the drop down list of language. Actually I saw "GNU C 4", "GNU C++ 4.7" and "GNU C++0x 4". Does "GNU C++ 4.7" option means run g++ command with --std=c++11?

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    GNU C++0x 4 is what you want for C++11.

»
10 years ago, # |
  Vote: I like it +25 Vote: I do not like it

I've updated g++/gcc to 4.9.2. We are using 32-bit MinGW on Windows 7 (64-bit OS). You can download it here: http://assets.codeforces.com/files/mingw-4.9.2.7z

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    May I ask what is the use of "-D__USE_MINGW_ANSI_STDIO=0" ?

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Now that you have g++ 4.9 please add the -std=c++1y option to the command line (or make it a different language, C++ 14)

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Add rust please, thank you !

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +12 Vote: I do not like it

    Yeah, Rust is a very fast language (it's on par with C++ in Mike's "binary heap" benchmark) with great templates system. However, it's probably not a good idea to add it right now, because it's still unstable. For example, std::io is marked as a "work in progress".

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +18 Vote: I do not like it

    Rust is shaping up to be a very nice modern successor to languages like C++ (more so than D or Go). The 1.0 beta came out today, so please if you're reading this Mike, this is a great time to add it! :-D

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +37 Vote: I do not like it
»
10 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Could you please consider adding Rust language.

»
10 years ago, # |
Rev. 2   Vote: I like it +28 Vote: I do not like it

Mike, could you please install Haskell Platform? It's quite annoying to implement Control.Monad.State again and again, while this monad is quite handful for input parsing.

»
10 years ago, # |
  Vote: I like it +8 Vote: I do not like it

For Ruby:

Ruby standard library hardly contains any algorithm implementation. Can you include for example "Ruby Algorithms and Containers project" by Kanwei Li 2009.

Anyway, PHP/Python/Ruby/Pearl are used for web development and scripting. Their standard input and output interface are very painful and inflexible unlink c/c++. But it's somehow fun to use them in easy-medium problems.

»
10 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Please update Scala compiler to 2.11.6. Looks like currently installed version (2.11.2) fails when parsing empty string to array of ints, which has caused my submission 10718173 for 536B - Tavas and Malekas to fail on test #55 (m=0), which works fine on my local machine with 2.11.6.

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I think you should remove the warning when you submit code that contains %lld. Both %I64d and %lld work fine with g++ now so now it is just annoying to submit the same code twice.

»
10 years ago, # |
  Vote: I like it +6 Vote: I do not like it

I experienced problems in using functions like to_string() and stoi() even when I select GNU C++11. The judge reports an error saying that it is not defined. Why is that so?

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone please give me an example of the correct code(the whole code) in Java for ANY question. Actually I am new here and wanted to know about the specifications required in the programs.

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Go to contest results for any finished contest and filter submissions by status and language using the panel on the right. Then clicking on the submission id link in the table will show you the code.

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Rust 1.0 was released so add rust please.

»
9 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

@Codeforces Is there a chance to install "blist" or "sortedcontainers" packages for Python?

Unfortunately Python built-in lists are not well optimized for extra-large arrays typically used in Codeforces contests (>>10^5 elements). Python has very sluggish inserts and pops behavior for these gigantic lists — O(N) take seconds because it has to update every single index in the list.

These packages are using B+ trees to store lists and provide O(log(n)) vs O(n) speed improvement for list dels and inserts (though by the cost of slower lookup) and are essential for solving binary search problems without getting a TLE.

https://pypi.python.org/pypi/blist/? https://pypi.python.org/pypi/sortedcontainers/?

»
9 years ago, # |
Rev. 3   Vote: I like it +8 Vote: I do not like it

Mike, could you remove the code style limitation in Scala? Unlike Java, we can write multiple class or package in one file. This is a big limitation to make libraries. For example, following code cannot be accepted in Codeforces.

// There maybe multiple package definition.
package net.pushl {
  object Test {
  }
}
package net.pushl {
  class Test2 {
  }
}

// Multiple classes or objects can be defined in one file.
class Solver(){
  def main() : Unit = {
    println("Hello world")
  }
}

object Main {
  def main(args : Array[String]){
    (new Solver).main()
  }
}

To run this code, you cannot use "scala" command because it reads source code as "script". Use "scalac main.scala; scala Main" instead.

Thanks.

»
9 years ago, # |
  Vote: I like it +14 Vote: I do not like it

Add rust please! It is an elegant language and I really hope to see it and use it in Codeforces contests.

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is it possible to update the Ocaml compiler from 4.00.1? Int64/Big_int performance is a bit lacking on this version. Newer versions appear to have improved this somewhat.

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    The problem is that the installed version is 32-bit, and it generates very slow int64 code.

»
9 years ago, # |
  Vote: I like it +4 Vote: I do not like it

Lets add Kotlin as a programming language.

It is new language from JetBrains for JVM. It is even supported by default in Intellij IDEA, I think that's enough for adding it.

»
9 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Hello,

I would like to write solutions in Lua. It is a 23-year-old language that doesn't have any novel features. The best interpreter for Lua is Luajit: http://luajit.org/

Thanks.

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Got this error when 2-minutes were left in the contest #339::Div2::C I thought "M_PI" was standard in "G++11" /--------------------------------------------------------------------/ Can't compile file: program.cpp: In function 'int main()':

program.cpp:191:10: error: 'M_PI' was not declared in this scope

ans=ans*M_PI; ^ /--------------------------------------------------------------------/ Submission Link http://codeforces.me/contest/614/submission/15372460

  • »
    »
    9 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    M_PI is not a standard C++ feature. You should define the constant yourself.

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Codeforces switched to GCC 5.1 and supports both C and C11 now. What are their compiler command lines?

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I wonder why specifically GCC 5.1 if the latest release in the GCC 5 series is 5.3.

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Perhaps because TDM-GCC is used, and 5.1 is the latest supported stable version.

      There are some alternatives (for example, MinGW-w64), but perhaps they are not that popular in contest programming.

»
9 years ago, # |
  Vote: I like it +3 Vote: I do not like it

javascript v8.does it mean it supports node.js too ?

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Could also please add support for Erlang?

As far as I know, CodeChef already supports it.

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Dear Mike,

Will you consider adding Julia? It is said to have the syntax of Python and speed of C. Honestly, I have not learnt it yet, but Codeforces has been such a great place for me to learn a new language. It would be great if you add it to Codeforces.

Thank you so much for this great platform.

»
9 years ago, # |
  Vote: I like it +23 Vote: I do not like it

I'd like to throw in my vote for Rust again. We're at 1.7 now and climbing.

»
9 years ago, # |
  Vote: I like it +26 Vote: I do not like it

I found that Safe Haskell was turned on in codeforces, which made a lot of modules unavailable, such as

Control.Monad.ST
Data.Array.Base (unsafeRead, unsafeWrite)
Data.Array.MArray
System.IO.Unsafe (unsafePerformIO)

This is very annoying as the word "safe" here has nothing to do with the safety of online judge, but more likely to disable a lot of unsafe (non-pure or something can make your program behavior weird or crash) modules for optimization. Can we disable this. And what exact flags are used for Haskell now?

Also, can we have ghc7.10 as a separate compiler? (I don't mind if it replaces ghc7.8 though) As ghc changed a lot in 7.10 due to https://wiki.haskell.org/Functor-Applicative-Monad_Proposal and many code won't compile.

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Agree with you! -XSafe has nothing to do with the safety, users can still use "System.Process.system" or other malicious functions, it just prohibit many legal techniques which are essential for high performance such as Control.Monad.ST, Data.Array.Base.

    At the moment, we may resort to safer versions: Control.Monad.ST.Safe, Data.Array.IO.Safe, Data.Array.IO.ST.Safe .

»
9 years ago, # |
  Vote: I like it +18 Vote: I do not like it

Since g++ version was updated to 5.1, can you change the compilation flag -std=c++11 to -std=c++14?

»
9 years ago, # |
  Vote: I like it +1 Vote: I do not like it

I used regex in GNU C++ 11 and got a CE:

    error: use of deleted function 'bool std::regex_match(...

but I complied my code successfully with G++ 4.9.1 using -std=c++11
I wonder whether it is my fault or regex is not allowed.

My submission
16757403

»
9 years ago, # |
  Vote: I like it +13 Vote: I do not like it

Haskell seems to be compiled with -XSafe flag, which makes using ST Monads impossible.

How to reproduce:

import Control.Monad.ST
main = return ()

Plus. it would be nice if we have the latest ghc :-) Since the standard library shipped with the current version is a little out-dated.

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Erh, by the way, Safe Haskell has nothing to do with the safety of the host machine. It's just a restriction imposed on how you could use the language. It's actually kind of like the opposite of -fpermissive

»
9 years ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

Haskell is unusable on codeforces without Control.Monad.ST. Please remove -XSafe option. It doesn't make haskell safer for test system!

Also current Haskell settlement lacks Data.Vector package. Haskell Platform should be used instead of bare GHC compiler. It's like Java or .NET without collection libraries https://www.haskell.org/platform/

»
8 years ago, # |
Rev. 3   Vote: I like it +24 Vote: I do not like it

Rust, please.

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I think Visual Basic.NET is a good language.And Visual Basic.NET is in top 10 every year nearly.Visual Basic.NET is ninth in Jun 2016 from TIOBE programming language list.So i suggest MikeMirzayanov add Visual Basic.NET 6.0 to CodeForces programming languages list.

»
7 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

Can you please update the Go compiler version until 1.8 or 1.9? There are some incompatible differences between 1.7 and 1.8/1.9 that makes difficult to test solutions.

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Could you update PyPy and, especially, PyPy3, please? There were some changes in the stdlib since Python 3.2. The JIT got smarter, too.

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

What is the linux-based equivalent for parameter --stack=268435456 ??

And is this considered the memory limit for the problem ?

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

please fix syntax highlighting for rust submissions 39259717

"Custom invocation" page shows correct highlighting, so why not to use the same ace editor here

»
6 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Could you please upgrade the version of haskell to 8.4 ?

thanks

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Do you plan to add Petooh compiler?

»
6 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Could you please update version of java to 11?

It should also affect kotlin.

»
6 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

Can we please get SBCL (the most popular implementation of Common Lisp) support? It is an extremely mature Lisp and probably the most performant one around right now.

»
6 years ago, # |
  Vote: I like it +16 Vote: I do not like it

+1 for Julia — would be amazing to have it supported.

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

need Kotlin

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there any plan to add Swift?

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I think stack sizes should be increased as much as possible. It seem it doesn't hurt even if the limit is more than a memory limit, so we can just set the limit to few gygabytes.

It will allow focus on algorithmic part of problem solving instead of learning some platform-dependent hacks

I'm talking mostly about c++, not sure if there are downsides for other languages (e.g possibility to use more memory because stack is handled incorrectly and/or problems with GC)

cc MikeMirzayanov

»
6 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Please bring back F#! After so many years the language and compiler have improved a lot, I believe it is worth a re-assessment for adding into the platform.

Sorry for the ping MikeMirzayanov...

»
5 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

Thanks for the platform and problems!

Could we have the latest C# compiler? Mono C# compiler version 5.18 is late! There is already 6.4.0 with great mcs which supports C# 6th version and some 7th. Or we can use .Net Core compiler, csc.

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I want to know which compiler version is used for Rust.

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

This post seems not up-to-date. Is there an updated list of compiler versions and compilation commands somewhere?

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is Dlang somehow broken on Codeforces? Even the simple hello world program cannot execute successfully with custom invocation.

Code

import std;

void main()
{
    writeln("hello world");
}

Result

Aborting from 
object.Error@(0): Access Violation

Runtime error: exit code is 1
=====
Used: 0 ms, 204 KB
  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    The import std; line currently does not work. Probably because some library from the whole set, like network and such, triggers security checks. Works fine when you specify individual imports you need.

    Here is a recent discussion of a similar matter, with Python & D involved.

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      I encountered the exact same problem yesterday. Do you think it can be fixed by removing those libraries from being imported in std/package.d?

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

WE WANT BRAINFUCK DUDE

»
5 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Please update Node.js to version 10.4.0 or higher, since it supports BigInt

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

any updates on c++17?

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I want to put in a request to upgrade the version of Ruby interpreter to more a recent version like 2.7.0. https://www.ruby-lang.org/en/downloads/releases/ The current version (2.0.0p353) is from 2013 and new convenience functions have been released which would make Ruby more usable.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I've recently run into an issue that ruby code was working fine locally, but was raising RuntimeError in CF.

    MikeMirzayanov please update ruby to the latest release: 2.7.1. The version that is currently in Codeforces (2.0.0) is much too old. (The version 2.4 has recently been deprecated.)

»
5 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

MikeMirzayanov kindly please update Scala from 2.12.8 to the latest 2.13.3. It contains many performance improvements and new features relevant to Competitive Programming (some of them were contributed by members of CodeForces community).

Thank you in advance.

»
5 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Can we have GDC/LDC please?

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Please add Swift! It has really clean syntax

»
4 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Great work for updating compilers!

Unfortunately, mono C# compiler mcs doesn't support some latest C# features, so I'd like to use csc compilers that supports full C# 8.0. Or supporting .NET Core platform in addition to mono like AtCoder will be also fine. Thanks!

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

The current D language is 32-bit. This causes unexpected bugs while compilation like, array indices cannot be long. (see 92492947 and 92493027). This problem does not occur on any of the latest versions of D or on the codechef compiler. MikeMirzayanov could you please upgrade compiler to the latest 64-bit version.
Thanks in advance!
Also, it would be good if ldc -O could be used instead of dmd so problems run faster.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

MikeMirzayanov std::reduce broken for C++17 (both GNU C++17 and GNU C++17(64))

See 95894458, here ooo(v) means v.begin(), v.end()

»
4 years ago, # |
  Vote: I like it +10 Vote: I do not like it

MikeMirzayanov Would be wonderful if you could add Julia :) seem as it was previously asked for here.

Ido

»
4 years ago, # |
  Vote: I like it +10 Vote: I do not like it

Would be nice if we could add Julia. It has a very succinct syntax that makes it easy for prototyping, yet it is (unlike other scripting languages like Python) blazingly fast. Here is a report of a participant using Julia in a contest: https://software.intel.com/sites/default/files/managed/73/11/delacorte-julia-rev2.pdf

We would just need to make sure that JIT compiling (which might take a short moment) is not added to the runtime.

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

MikeMirzayanov Could you please increase the Ruby interpreter stack size limit for better feature parity with the other programming languages? This can be done by defining RUBY_THREAD_VM_STACK_SIZE environment variable.

Right now any deep recursion results in a "Runtime error" verdict for Ruby solutions. It's probably not the best example, but you can have a look at these two submissions for the same problem: https://codeforces.me/contest/1513/submission/113150131 and https://codeforces.me/contest/1513/submission/113150168 (one is using recursion and the other doesn't).

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Hi! What are compilation options for Rust submissions? When I run the test locally with cargo test --release, I see execution time more than 10 times lower than at Codeforces.

»
3 years ago, # |
  Vote: I like it +5 Vote: I do not like it

Could you update the OCaml compiler? That would be much appreciated :)

»
23 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Hello! Can you add Common Lisp as a supported language please? It is a very powerful language that can run at speed of c++ and is even more expressive than python.

  • »
    »
    23 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    MikeMirzayanov In hope that it will be able to help (judging by comment to Julia request):


    Here is an implementation of binary heap sort benchmark in common lisp: https://github.com/Gleefre/binary-heap-benchmark/blob/master/common-lisp/heap.lisp (and I'll be glad to create a PR if wanted).

    One of the best open source common lisp implementations is probably SBCL which can be installed here.

    A common lisp script can be run with sbcl like this: sbcl --script <filename>.

    Or, if (probably) needed, with an increased/decreased dynamic stack size: sbcl --dynamic-space-size <megabytes> --script <filename>. It's default value is platform dependent.

    On my computer, heap.lisp benchmark results in a range of [693..846] ms with an average time of 701.69 ms.


    The problem 1A — Theatre Square can be solved like this:

    (defun theatre-square (n m a)
      (* (1+ (floor (1- n) a))
         (1+ (floor (1- m) a))))
    
    (format t "~a~%" (theatre-square (read) (read) (read)))
    
»
23 months ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

Hello, can you please consider increasing the stack size limit for Ruby? I have been practicing the language recently, and realized that the language has a 1MiB stack size limit by default. This limit makes a lot of things impossible for the language in CP (i.e. it dies here and there due to SystemStackError). This issue has been existent on other online judges as well, and I hope to see a resolution to this issue on Codeforces (and other judges as well). The language is mostly great (The ability to write concise code is a good thing in CP after all), and I hope other people could enjoy the language in CP as well. Still, this change may be crucial for people to truly enjoy the experience, without too many frustrations. (I won't complain about the language being too slow, sacrificing speed for conciseness is a good deal)

UPD: An update to Ruby 3.1.0 (or higher) would be a good change as well!

»
11 months ago, # |
  Vote: I like it -9 Vote: I do not like it

Can we ask for updates to some compiler versions? I want to practice OCaml with CF. However, the OCaml version extremely outdated and lacking basic primitives like List.init. Thanks in advance!

»
7 months ago, # |
  Vote: I like it 0 Vote: I do not like it

We want LuaJIT as a interpreted language. Please, add it to the website.