MikeMirzayanov's blog

By MikeMirzayanov5 years ago, translation, In English,

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 -fno-optimize-sibling-calls -fno-strict-aliasing -DONLINE_JUDGE -lm -s -x c++ -Wl,--stack=268435456 -O2 -o {filename}.exe {file}

  2. GNU C++11 4
    g++.exe -static -fno-optimize-sibling-calls -fno-strict-aliasing -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 2.10.9.0
  • 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.7.2
  • Haskell Glorious Glasgow, version 7.6.1
  • Java 6 javac 1.6.0_37
  • Java 7 javac 1.7.0_55
  • Java 8 javac 1.8.0_05
  • Ocaml ocamlopt 4.00.1
  • Perl v5.12.2
  • PHP 5.3.8
  • Python 2.7.4
  • Python 3.3.2
  • Ruby 2.0.0p353
  • Scala compiler version 2.11.1
  • MS VS C++ 2010
  • JavaScript V8 3.23.0
 
 
 
 

 
4 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.
 
4 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?
 
4 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?
 
4 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.

  •  
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Fixed, thank you!
    •  
      4 years ago, # ^ |
        Vote: I like it +12 Vote: I do not like it
      "There are plans to add Haskell." may be removed
    •  
      3 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).
      •  
        3 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.
    •  
      5 weeks 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
Why Perl is not allowed ?
I don't know to whom should I request the same.
  •  
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    I agree, it would be awesome if perl were supported!
  •  
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Problem just for Perl: download problems statistics from Topcoder and parse it :D 
 
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I would also like you to see this
http://codeforces.com/blog/entry/405
 
4 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.
  •  
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    That would be great.
  •  
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    While only Clojure? What about Scala?
    •  
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Vote for Scala. (Clojure will be also good). 
      •  
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        scala is a good idea so i can avoid python...
  •  
    3 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.
    •  
      17 months ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      True, I have encountered that problem while solving problems and using Python.

      Maybe we could use the slightly faster Python 3.x?

 
4 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. 

  •  
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Agree with you! We need C# 4.0 to use all its power :)
 
4 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

 
4 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? :'(
  •  
    4 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?
    •  
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Ya, I understand and I'm trying that now. :) Thank you
 
3 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.
 
3 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)
 
3 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 :(
  •  
    3 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
 
3 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...
  •  
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    If you want that, press here to the green button .
  •  
    3 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.
 
3 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
  •  
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    I have been able to use any class name. However, one must place it in the default package. If you accidentally place it in another package, you will get Runtime Error on the first test case, which won't count in the contest as a failed attempt.
 
3 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.
 
»
3 years ago, # |
  Vote: I like it +12 Vote: I do not like it
Update to Java 7?
  •  
    »
    »
    3 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?
    •  
      »
      »
      »
      3 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.
 
»
3 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.
  •  
    »
    »
    2 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.

 
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Why cant we use SortedSet / BigInteger etc in C# ?
Is is possible to include needed libraries / dependencies?

Thanks.
 
»
2 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.

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

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.

 
»
2 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...

 
»
2 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

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

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

 
»
2 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.

  •  
    »
    »
    2 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.

 
»
2 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???

  •  
    »
    »
    2 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 ?

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

      thank you! I almost deleted the whole code without knowing that simply reordering the classes would solve the problem :)

 
»
23 months 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

 
»
23 months 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...

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

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

  •  
    »
    »
    23 months 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...

 
»
21 month(s) 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.

  •  
    »
    »
    21 month(s) 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.

 
»
20 months 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)?

 
»
20 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Add Go and Rust please, thank you

 
»
19 months 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?

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

    -std=c++0x

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

      thanks

    •  
      »
      »
      »
      19 months 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).

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

      Please make it -std=c++11

    •  
      »
      »
      »
      17 months 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;
      }
      
 
»
19 months 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.com/contest/266/submission/2991670 http://codeforces.com/contest/268/submission/3021653 http://codeforces.com/contest/268/submission/3022677 http://codeforces.com/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?

 
»
17 months 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?

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

OK, I know that [almost] nobody likes it, and that maybe it's not the best thing for programming [contests], but I would really like to use Fortran in the contests. So, that's it. Thanks anyway!

 
»
16 months 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.

 
»
16 months 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.

 
»
16 months 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.

 
»
16 months 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.

  •  
    »
    »
    16 months 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

 
»
13 months 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.

 
»
13 months 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.

 
»
13 months 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.

  •  
    »
    »
    13 months 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

    •  
      »
      »
      »
      13 months 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.

  •  
    »
    »
    13 months 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?

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

      On my machine, unsigned long was stored on 8 bytes, here on 4. I did not think of this. :) Using long long unsigned did the job.

      Thanks.

 
»
9 months 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

 
»
9 months 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

  •  
    »
    »
    9 months 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...)

    •  
      »
      »
      »
      3 months 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.

      •  
        »
        »
        »
        »
        3 months 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!

        •  
          »
          »
          »
          »
          »
          8 days 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

 
»
5 months 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

  •  
    »
    »
    5 months 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).

    •  
      »
      »
      »
      5 months 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.

 
»
5 months ago, # |
  Vote: I like it -8 Vote: I do not like it

c++ is my favorite language.

 
»
4 months 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.

 
»
3 months 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? :)

 
»
3 months 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.

 
»
2 months 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?

 
»
5 weeks 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.

 
»
8 days 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.