Every time I submit in Java, it results in CE.

The following is an example of possible causes.。

  • The file name in Java is not spelled as Main
  • CORRECT

    import java.util.*;
    public class Main {// Main
        public static void main(String[] args){
            .
            .
            .
        }
    }							

    WRONG( It is spelled as "main." )

    import java.util.*;
    public class main {// Not Main
        public static void main(String[] args){
            .
            .
            .
        }
    }							

    In this case, the following compile message will appear.

    Main.java:4: class main is public, should be declared in a file named main.java
    public class main {
    ^
    1 error						

I don't know what is causing RE.

The following is a list of common causes.

  1. C/C++you have to do return 0; within int-type main function.
  2. CORRECT

    #include<stdio.h>
    int main()
    {
        // Something...
        return 0;
    }							

    WRONG (Type of main function is void.)

    #include<stdio.h>
    void main()
    {
        // Something...
    }							

    WRONG (The return value of main function is not 0.)

    #include<stdio.h>
    #define true 1
    int main()
    {
        if(true)return 1;
        return 0;
    }							
  3. Make sure not to contain division by zero.
  4. int res = 2/0;

    Please be very careful especially when you are using a variable as a denominator.

    for(int i = 0; i < 100; i++){
        res = res + 1/i;
    }							
  5. Be aware of out-of-range access of array.
  6. int a[10];
    printf("%d", a[10]);		

When RE occurs, in some cases you may be able to see the compile message by going to the Results on the top of the screen then show Details on the right side of the screen.


What are the available programming languages?

Language言語Compile/Interpreterコンパイル・インタプリタExecution Command実行方法
Bash (GNU bash v4.3.11)cat Main.sh | tr -d '\r' >a.outbash a.out
C (GCC 5.3.0)gcc -std=gnu11 -O2 -o a.out Main.c -lma.out
C++14 (GCC 5.3.0)g++ -std=gnu++1y -O2 -I/opt/boost/gcc/include -L/opt/boost/gcc/lib -o a.out Main.cppa.out
C (Clang 3.8.0)clang -O2 Main.c -o a.out -lma.out
C++14 (Clang 3.8.0)clang++ -I/usr/local/include/c++/v1 -L/usr/local/lib -I/opt/boost/clang/include -L/opt/boost/clang/lib -std=c++14 -stdlib=libc++ -O2 -o a.out Main.cppa.out
C# (Mono 4.2.2.30)mcs -warn:0 -o+ -r:System.Numerics Main.csmono Main.exe
Clojure (1.8.0)echojava -cp /opt/clojure/clojure-1.8.0.jar clojure.main Main.clj
Common Lisp (SBCL 1.1.14)echosbcl --script Main.lisp
D (DMD64 v2.070.1)dmd -m64 -w -O -release -inline Main.dMain
D (LDC 0.17.0)ldc2 -O Main.d -of a.outa.out
D (GDC 4.9.3)gdc-4.9 -O2 -frelease -o a.out Main.da.out
Fortran (gfortran v4.8.4)gfortran -O2 -o a.out Main.f08a.out
Go (1.6)go build -o a.out Main.goa.out
Haskell (GHC 7.10)ghc -o a.out -O2 Main.hsa.out
Java7 (OpenJDK 1.7.0)/usr/lib/jvm/java-7-openjdk-amd64/bin/javac Main.java/usr/lib/jvm/java-7-openjdk-amd64/bin/java Main
Java8 (OpenJDK 1.8.0)/usr/lib/jvm/java-8-openjdk-amd64/bin/javac Main.java/usr/lib/jvm/java-8-openjdk-amd64/bin/java Main
JavaScript (node.js v5.7)echonode Main.js
OCaml (4.02.3)bash -c 'eval $(opam config env) ocamlfind ocamlopt -o a.out Main.ml -linkpkg -thread -package str,num,threads,batteries'a.out
Pascal (FPC 2.6.2)fpc -O2 -Sd -Sh -oa.out Main.pasa.out
Perl (v5.18.2)perl -W -c Main.plperl -X Main.pl
PHP (5.6.18)php5.6 -l Main.phpphp5.6 Main.php
Python2 (2.7.6)echopython -B Main.py
Python3 (3.4.3)echopython3 -B Main.py
Ruby (2.3.0)ruby2.3 --disable-gems -w -c Main.rbruby2.3 --disable-gems Main.rb
Scala (2.11.7)scalac -optimise Main.scalascala Main
Scheme (Gauche 0.9.3.3)echogosh Main.scm
Text (cat)cat Main.txt | tr -d '\r' >a.outcat a.out
Visual Basic (Mono 4.2.2.30)vbnc /noconfig /r:Accessibility.dll /r:System.dll /r:System.Data.dll /r:System.Xml.dll /r:System.Core.dll /r:System.Numerics.dll /r:System.Configuration.dll /r:System.Xml.dll /imports:System /imports:Microsoft.VisualBasic /OptionExplicit+ /removeintchecks+ /optimize+ /debug- Main.vbmono Main.exe
Objective-C (GCC 5.3.0)gcc -O2 Main.m -o a.out -lobjc -lgnustep-base -I/usr/include/GNUstep -fconstant-string-class=NSConstantStringa.out
Objective-C (Clang3.7.1)clang -O2 Main.m -o a.out -lobjc -lgnustep-base -I/usr/lib/gcc/x86_64-linux-gnu/4.8/include/ -I/usr/include/GNUstep -fconstant-string-class=NSConstantStringa.out
Swift (swift-2.2-RELEASE)swiftc -o a.out Main.swifta.out
Rust (1.7.0)rustc -O -o a.out Main.rsa.out
Sed (GNU sed 4.2.2)cat Main.sed | tr -d '\r' >a.outsed -f a.out
Awk (mawk 1.3.3)cat Main.awk | tr -d '\r' >a.outawk -f a.out
Brainfuck (bf 20041219)cat Main.bf | tr -d '\r' >a.outbf a.out
Standard ML (MLton 20100608)mlton -output a.out Main.mla.out
PyPy2 (4.0.1)echopypy Main.py
PyPy3 (2.4.0)echopypy3 Main.py
Crystal (0.12.0)crystal build Main.crMain
F# (Mono 4.2.2.30)fsharpc Main.fsmono Main.exe
Unlambda (0.1.3)cat Main.unl | tr -d '\r' >a.outsh -c 'cat a.out - | unlambda'
Lua (5.3.2)luac -o luac.out Main.lualua luac.out
LuaJIT (2.0.2)luajit -O3 -b Main.lua luac.outluajit -O3 luac.out
MoonScript (0.4.0)moonc -o a.out Main.moonmoon Main.moon
Ceylon (1.2.1)ceylon compile --source=. Main.ceylonceylon run --run main default
Julia (0.4.2)echojulia Main.jl
Octave (4.0.0)echooctave --jit-compiler Main.m
Nim (0.13.0)nim c -d:release -o:a.out Main.nima.out
TypeScript (1.8.2)tsc Main.tsnode Main.js
Perl6 (rakudo-star 2016.01)perl6 -W -c Main.p6perl6 Main.p6
Kotlin (1.0.0)kotlinc Main.kt -include-runtime -d Main.jarkotlin -classpath Main.jar MainKt
PHP7 (7.0.4)php7.0 -l Main.phpphp7.0 Main.php

ライブラリ

対象言語ライブラリ名補足
C++(g++/clang++)Boostバージョン: 1.60.0
Python2numpyapt-get install python-numpy で入るもの
Python2scipyapt-get install python-scipy で入るもの
Python2? Python3?scikitsapt-get install python-scikits-learn で入るもの
Python3numpyapt-get install python3-numpy で入るもの
Python3scipyapt-get install python3-scipy で入るもの
SwiftFoundationバージョン: swift-2.2-SNAPSHOT-2016-01-11-a
SwiftXCTestバージョン: swift-2.2-SNAPSHOT-2016-01-11-a

I can' log in.

Make sure your user id and password are entered correctly.

Also make sure to use half-width characters (Hankauku).


I want to change my registered information.

You can change your personal information here and password here. You can also open the Setting menu by pressing your user name on the upper right.

Judge Status is still WJ and does not return the result.

Please reply to the Twitter account of AtCoder .

Although we are not monitoring 24/7, we will get back to you as soon as possible.


What is your Copyright Policy?

Please refer the chapter for Intellectual Property in the User Policy .

Javaで提出すると必ずCEになります

よくある原因としては以下の例があります。

  • Javaでのファイル名がMainになってない。
  • せいかい

    import java.util.*;
    public class Main {//ここが Main になっている
        public static void main(String[] args){
            .
            .
            .
        }
    }							

    まちがい( mainになっている )

    import java.util.*;
    public class main {// Main になっていない!!
        public static void main(String[] args){
            .
            .
            .
        }
    }							

    この場合、コンパイルメッセージは以下のようになっています。

    Main.java:4: class main is public, should be declared in a file named main.java
    public class main {
    ^
    1 error						

REの原因がわかりません

よくある原因としては以下の例があります。

  1. C/C++においては、int型のmain関数内でreturn 0;する必要があります。
  2. せいかい

    #include<stdio.h>
    int main()
    {
        //何らかの処理の後
        return 0;
    }							

    まちがい( main関数の型がvoid )

    #include<stdio.h>
    void main()
    {
        //main関数をint型で宣言して、return 0;を返してください
    }							

    まちがい( main関数の返り値が0ではない )

    #include<stdio.h>
    #define true 1
    int main()
    {
        //このif文は必ず真なので、return 1;が実行される
        if(true)return 1;
        return 0;
    }							
  3. ゼロ除算に気をつけてください。
  4. int res = 2/0;

    分数の分母に変数を用いる場合は特に注意してください。

    for(int i = 0; i < 100; i++){
        res = res + 1/i;
    }							
  5. 配列の範囲外アクセスに注意してください。
  6. int a[10];
    printf("%d", a[10]);		

また、REの場合は、画面上部の「結果」=>画面右側の「詳細を確認」から、「コンパイルメッセージ」を確認できる場合があります。


使用できる言語は何がありますか

Language言語Compile/Interpreterコンパイル・インタプリタExecution Command実行方法
Bash (GNU bash v4.3.11)cat Main.sh | tr -d '\r' >a.outbash a.out
C (GCC 5.3.0)gcc -std=gnu11 -O2 -o a.out Main.c -lma.out
C++14 (GCC 5.3.0)g++ -std=gnu++1y -O2 -I/opt/boost/gcc/include -L/opt/boost/gcc/lib -o a.out Main.cppa.out
C (Clang 3.8.0)clang -O2 Main.c -o a.out -lma.out
C++14 (Clang 3.8.0)clang++ -I/usr/local/include/c++/v1 -L/usr/local/lib -I/opt/boost/clang/include -L/opt/boost/clang/lib -std=c++14 -stdlib=libc++ -O2 -o a.out Main.cppa.out
C# (Mono 4.2.2.30)mcs -warn:0 -o+ -r:System.Numerics Main.csmono Main.exe
Clojure (1.8.0)echojava -cp /opt/clojure/clojure-1.8.0.jar clojure.main Main.clj
Common Lisp (SBCL 1.1.14)echosbcl --script Main.lisp
D (DMD64 v2.070.1)dmd -m64 -w -O -release -inline Main.dMain
D (LDC 0.17.0)ldc2 -O Main.d -of a.outa.out
D (GDC 4.9.3)gdc-4.9 -O2 -frelease -o a.out Main.da.out
Fortran (gfortran v4.8.4)gfortran -O2 -o a.out Main.f08a.out
Go (1.6)go build -o a.out Main.goa.out
Haskell (GHC 7.10)ghc -o a.out -O2 Main.hsa.out
Java7 (OpenJDK 1.7.0)/usr/lib/jvm/java-7-openjdk-amd64/bin/javac Main.java/usr/lib/jvm/java-7-openjdk-amd64/bin/java Main
Java8 (OpenJDK 1.8.0)/usr/lib/jvm/java-8-openjdk-amd64/bin/javac Main.java/usr/lib/jvm/java-8-openjdk-amd64/bin/java Main
JavaScript (node.js v5.7)echonode Main.js
OCaml (4.02.3)bash -c 'eval $(opam config env) ocamlfind ocamlopt -o a.out Main.ml -linkpkg -thread -package str,num,threads,batteries'a.out
Pascal (FPC 2.6.2)fpc -O2 -Sd -Sh -oa.out Main.pasa.out
Perl (v5.18.2)perl -W -c Main.plperl -X Main.pl
PHP (5.6.18)php5.6 -l Main.phpphp5.6 Main.php
Python2 (2.7.6)echopython -B Main.py
Python3 (3.4.3)echopython3 -B Main.py
Ruby (2.3.0)ruby2.3 --disable-gems -w -c Main.rbruby2.3 --disable-gems Main.rb
Scala (2.11.7)scalac -optimise Main.scalascala Main
Scheme (Gauche 0.9.3.3)echogosh Main.scm
Text (cat)cat Main.txt | tr -d '\r' >a.outcat a.out
Visual Basic (Mono 4.2.2.30)vbnc /noconfig /r:Accessibility.dll /r:System.dll /r:System.Data.dll /r:System.Xml.dll /r:System.Core.dll /r:System.Numerics.dll /r:System.Configuration.dll /r:System.Xml.dll /imports:System /imports:Microsoft.VisualBasic /OptionExplicit+ /removeintchecks+ /optimize+ /debug- Main.vbmono Main.exe
Objective-C (GCC 5.3.0)gcc -O2 Main.m -o a.out -lobjc -lgnustep-base -I/usr/include/GNUstep -fconstant-string-class=NSConstantStringa.out
Objective-C (Clang3.7.1)clang -O2 Main.m -o a.out -lobjc -lgnustep-base -I/usr/lib/gcc/x86_64-linux-gnu/4.8/include/ -I/usr/include/GNUstep -fconstant-string-class=NSConstantStringa.out
Swift (swift-2.2-RELEASE)swiftc -o a.out Main.swifta.out
Rust (1.7.0)rustc -O -o a.out Main.rsa.out
Sed (GNU sed 4.2.2)cat Main.sed | tr -d '\r' >a.outsed -f a.out
Awk (mawk 1.3.3)cat Main.awk | tr -d '\r' >a.outawk -f a.out
Brainfuck (bf 20041219)cat Main.bf | tr -d '\r' >a.outbf a.out
Standard ML (MLton 20100608)mlton -output a.out Main.mla.out
PyPy2 (4.0.1)echopypy Main.py
PyPy3 (2.4.0)echopypy3 Main.py
Crystal (0.12.0)crystal build Main.crMain
F# (Mono 4.2.2.30)fsharpc Main.fsmono Main.exe
Unlambda (0.1.3)cat Main.unl | tr -d '\r' >a.outsh -c 'cat a.out - | unlambda'
Lua (5.3.2)luac -o luac.out Main.lualua luac.out
LuaJIT (2.0.2)luajit -O3 -b Main.lua luac.outluajit -O3 luac.out
MoonScript (0.4.0)moonc -o a.out Main.moonmoon Main.moon
Ceylon (1.2.1)ceylon compile --source=. Main.ceylonceylon run --run main default
Julia (0.4.2)echojulia Main.jl
Octave (4.0.0)echooctave --jit-compiler Main.m
Nim (0.13.0)nim c -d:release -o:a.out Main.nima.out
TypeScript (1.8.2)tsc Main.tsnode Main.js
Perl6 (rakudo-star 2016.01)perl6 -W -c Main.p6perl6 Main.p6
Kotlin (1.0.0)kotlinc Main.kt -include-runtime -d Main.jarkotlin -classpath Main.jar MainKt
PHP7 (7.0.4)php7.0 -l Main.phpphp7.0 Main.php

ライブラリ

対象言語ライブラリ名補足
C++(g++/clang++)Boostバージョン: 1.60.0
Python2numpyapt-get install python-numpy で入るもの
Python2scipyapt-get install python-scipy で入るもの
Python2? Python3?scikitsapt-get install python-scikits-learn で入るもの
Python3numpyapt-get install python3-numpy で入るもの
Python3scipyapt-get install python3-scipy で入るもの
SwiftFoundationバージョン: swift-2.2-SNAPSHOT-2016-01-11-a
SwiftXCTestバージョン: swift-2.2-SNAPSHOT-2016-01-11-a

ログインできません

ユーザID、パスワードに誤りがないか確認してください。

また、半角文字列で入力されていることを確認してください。


登録情報を変更したいです

所属などの変更はこちらから、パスワードの変更はこちらからできます。
右上のユーザ名を押すことでも設定画面が開きます。

ジャッジがWJのまま結果が返って来ません

TwitterのAtCoderアカウントにリプライしていただけるとありがたいです。

常に監視しているわけではありませんが、できるだけ迅速に対応させて頂きます。


著作権について教えてください

利用規約の知的財産の項を参照してください。