The following is an example of possible causes.。
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
The following is a list of common causes.
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; }
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; }
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.
Language言語 | Compile/Interpreterコンパイル・インタプリタ | Execution Command実行方法 |
---|---|---|
C++14 (GCC 5.4.1) | g++ -std=gnu++1y -O2 -I/opt/boost/gcc/include -L/opt/boost/gcc/lib -o a.out Main.cpp | a.out |
Bash (GNU bash v4.3.11) | cat Main.sh | tr -d '\r' >a.out | bash a.out |
C (GCC 5.4.1) | gcc -std=gnu11 -O2 -o a.out Main.c -lm | a.out |
C (Clang 3.8.0) | clang -O2 Main.c -o a.out -lm | a.out |
C++ (GCC 5.4.1) | g++ -std=gnu++03 -O2 -I/opt/boost/gcc/include -L/opt/boost/gcc/lib -o a.out Main.cpp | a.out |
C++ (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++03 -stdlib=libc++ -O2 -o a.out Main.cpp | a.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.cpp | a.out |
C# (Mono 4.6.2.0) | mcs -warn:0 -o+ -r:System.Numerics Main.cs | mono Main.exe |
Clojure (1.8.0) | echo | java -cp /opt/clojure/clojure-1.8.0.jar clojure.main Main.clj |
Common Lisp (SBCL 1.1.14) | echo | sbcl --script Main.lisp |
D (DMD64 v2.070.1) | dmd -m64 -w -O -release -inline Main.d | Main |
D (LDC 0.17.0) | ldc2 -O Main.d -of a.out | a.out |
D (GDC 4.9.4) | gdc-4.9 -O2 -frelease -o a.out Main.d | a.out |
Fortran (gfortran v4.8.4) | gfortran -O2 -o a.out Main.f08 | a.out |
Go (1.6) | go build -o a.out Main.go | a.out |
Haskell (GHC 7.10.3) | ghc -o a.out -O2 Main.hs | a.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 -Xss256M 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 -Xss256M Main |
JavaScript (node.js v5.12.0) | echo | node 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.pas | a.out |
Perl (v5.18.2) | perl -W -c Main.pl | perl -X Main.pl |
PHP (5.6.30) | php5.6 -l Main.php | php5.6 Main.php |
Python2 (2.7.6) | echo | python -B Main.py |
Python3 (3.4.3) | echo | python3 -B Main.py |
Ruby (2.3.3) | ruby2.3 --disable-gems -w -c Main.rb | ruby2.3 --disable-gems Main.rb |
Scala (2.11.7) | scalac -optimise Main.scala | scala Main |
Scheme (Gauche 0.9.3.3) | echo | gosh Main.scm |
Text (cat) | cat Main.txt | tr -d '\r' >a.out | cat a.out |
Visual Basic (Mono 4.0.1) | 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.vb | mono 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=NSConstantString | a.out |
Objective-C (Clang 3.8.0) | 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=NSConstantString | a.out |
Swift (swift-2.2-RELEASE) | swiftc -o a.out Main.swift | a.out |
Rust (1.15.1) | rustc -O -o a.out Main.rs | a.out |
Sed (GNU sed 4.2.2) | cat Main.sed | tr -d '\r' >a.out | sed -f a.out |
Awk (mawk 1.3.3) | cat Main.awk | tr -d '\r' >a.out | awk -f a.out |
Brainfuck (bf 20041219) | cat Main.bf | tr -d '\r' >a.out | bf a.out |
Standard ML (MLton 20100608) | mlton -output a.out Main.ml | a.out |
PyPy2 (5.6.0) | echo | pypy Main.py |
PyPy3 (2.4.0) | echo | pypy3 Main.py |
Crystal (0.20.5) | crystal build Main.cr | Main |
F# (Mono 4.0) | fsharpc Main.fs | mono Main.exe |
Unlambda (0.1.3) | cat Main.unl | tr -d '\r' >a.out | sh -c 'cat a.out - | unlambda' |
Lua (5.3.2) | luac -o luac.out Main.lua | lua luac.out |
LuaJIT (2.0.4) | luajit -O3 -b Main.lua luac.out | luajit -O3 luac.out |
MoonScript (0.5.0) | moonc -o a.out Main.moon | moon Main.moon |
Ceylon (1.2.1) | ceylon compile --source=. Main.ceylon | ceylon run --run main default |
Julia (0.5.0) | echo | julia Main.jl |
Octave (4.0.2) | echo | octave --jit-compiler Main.m |
Nim (0.13.0) | nim c -d:release -o:a.out Main.nim | a.out |
TypeScript (2.1.6) | tsc Main.ts | node Main.js |
Perl6 (rakudo-star 2016.01) | perl6 -W -c Main.p6 | perl6 Main.p6 |
Kotlin (1.0.0) | kotlinc Main.kt -include-runtime -d Main.jar | kotlin -classpath Main.jar -J-Xss256M MainKt |
PHP7 (7.0.15) | php7.0 -l Main.php | php7.0 Main.php |
対象言語 | ライブラリ名 | 補足 |
---|---|---|
C++(g++/clang++) | Boost | バージョン: 1.60.0 |
Python2 | numpy | apt-get install python-numpy で入るもの |
Python2 | scipy | apt-get install python-scipy で入るもの |
Python2? Python3? | scikits | apt-get install python-scikits-learn で入るもの |
Python3 | numpy | apt-get install python3-numpy で入るもの |
Python3 | scipy | apt-get install python3-scipy で入るもの |
Swift | Foundation | バージョン: swift-2.2-SNAPSHOT-2016-01-11-a |
Swift | XCTest | バージョン: swift-2.2-SNAPSHOT-2016-01-11-a |
Make sure your user id and password are entered correctly.
Also make sure to use half-width characters (Hankauku).
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.
よくある原因としては以下の例があります。
せいかい
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
よくある原因としては以下の例があります。
せいかい
#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; }
int res = 2/0;
分数の分母に変数を用いる場合は特に注意してください。
for(int i = 0; i < 100; i++){ res = res + 1/i; }
int a[10]; printf("%d", a[10]);
また、REの場合は、画面上部の「結果」=>画面右側の「詳細を確認」から、「コンパイルメッセージ」を確認できる場合があります。
Language言語 | Compile/Interpreterコンパイル・インタプリタ | Execution Command実行方法 |
---|---|---|
C++14 (GCC 5.4.1) | g++ -std=gnu++1y -O2 -I/opt/boost/gcc/include -L/opt/boost/gcc/lib -o a.out Main.cpp | a.out |
Bash (GNU bash v4.3.11) | cat Main.sh | tr -d '\r' >a.out | bash a.out |
C (GCC 5.4.1) | gcc -std=gnu11 -O2 -o a.out Main.c -lm | a.out |
C (Clang 3.8.0) | clang -O2 Main.c -o a.out -lm | a.out |
C++ (GCC 5.4.1) | g++ -std=gnu++03 -O2 -I/opt/boost/gcc/include -L/opt/boost/gcc/lib -o a.out Main.cpp | a.out |
C++ (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++03 -stdlib=libc++ -O2 -o a.out Main.cpp | a.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.cpp | a.out |
C# (Mono 4.6.2.0) | mcs -warn:0 -o+ -r:System.Numerics Main.cs | mono Main.exe |
Clojure (1.8.0) | echo | java -cp /opt/clojure/clojure-1.8.0.jar clojure.main Main.clj |
Common Lisp (SBCL 1.1.14) | echo | sbcl --script Main.lisp |
D (DMD64 v2.070.1) | dmd -m64 -w -O -release -inline Main.d | Main |
D (LDC 0.17.0) | ldc2 -O Main.d -of a.out | a.out |
D (GDC 4.9.4) | gdc-4.9 -O2 -frelease -o a.out Main.d | a.out |
Fortran (gfortran v4.8.4) | gfortran -O2 -o a.out Main.f08 | a.out |
Go (1.6) | go build -o a.out Main.go | a.out |
Haskell (GHC 7.10.3) | ghc -o a.out -O2 Main.hs | a.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 -Xss256M 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 -Xss256M Main |
JavaScript (node.js v5.12.0) | echo | node 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.pas | a.out |
Perl (v5.18.2) | perl -W -c Main.pl | perl -X Main.pl |
PHP (5.6.30) | php5.6 -l Main.php | php5.6 Main.php |
Python2 (2.7.6) | echo | python -B Main.py |
Python3 (3.4.3) | echo | python3 -B Main.py |
Ruby (2.3.3) | ruby2.3 --disable-gems -w -c Main.rb | ruby2.3 --disable-gems Main.rb |
Scala (2.11.7) | scalac -optimise Main.scala | scala Main |
Scheme (Gauche 0.9.3.3) | echo | gosh Main.scm |
Text (cat) | cat Main.txt | tr -d '\r' >a.out | cat a.out |
Visual Basic (Mono 4.0.1) | 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.vb | mono 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=NSConstantString | a.out |
Objective-C (Clang 3.8.0) | 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=NSConstantString | a.out |
Swift (swift-2.2-RELEASE) | swiftc -o a.out Main.swift | a.out |
Rust (1.15.1) | rustc -O -o a.out Main.rs | a.out |
Sed (GNU sed 4.2.2) | cat Main.sed | tr -d '\r' >a.out | sed -f a.out |
Awk (mawk 1.3.3) | cat Main.awk | tr -d '\r' >a.out | awk -f a.out |
Brainfuck (bf 20041219) | cat Main.bf | tr -d '\r' >a.out | bf a.out |
Standard ML (MLton 20100608) | mlton -output a.out Main.ml | a.out |
PyPy2 (5.6.0) | echo | pypy Main.py |
PyPy3 (2.4.0) | echo | pypy3 Main.py |
Crystal (0.20.5) | crystal build Main.cr | Main |
F# (Mono 4.0) | fsharpc Main.fs | mono Main.exe |
Unlambda (0.1.3) | cat Main.unl | tr -d '\r' >a.out | sh -c 'cat a.out - | unlambda' |
Lua (5.3.2) | luac -o luac.out Main.lua | lua luac.out |
LuaJIT (2.0.4) | luajit -O3 -b Main.lua luac.out | luajit -O3 luac.out |
MoonScript (0.5.0) | moonc -o a.out Main.moon | moon Main.moon |
Ceylon (1.2.1) | ceylon compile --source=. Main.ceylon | ceylon run --run main default |
Julia (0.5.0) | echo | julia Main.jl |
Octave (4.0.2) | echo | octave --jit-compiler Main.m |
Nim (0.13.0) | nim c -d:release -o:a.out Main.nim | a.out |
TypeScript (2.1.6) | tsc Main.ts | node Main.js |
Perl6 (rakudo-star 2016.01) | perl6 -W -c Main.p6 | perl6 Main.p6 |
Kotlin (1.0.0) | kotlinc Main.kt -include-runtime -d Main.jar | kotlin -classpath Main.jar -J-Xss256M MainKt |
PHP7 (7.0.15) | php7.0 -l Main.php | php7.0 Main.php |
対象言語 | ライブラリ名 | 補足 |
---|---|---|
C++(g++/clang++) | Boost | バージョン: 1.60.0 |
Python2 | numpy | apt-get install python-numpy で入るもの |
Python2 | scipy | apt-get install python-scipy で入るもの |
Python2? Python3? | scikits | apt-get install python-scikits-learn で入るもの |
Python3 | numpy | apt-get install python3-numpy で入るもの |
Python3 | scipy | apt-get install python3-scipy で入るもの |
Swift | Foundation | バージョン: swift-2.2-SNAPSHOT-2016-01-11-a |
Swift | XCTest | バージョン: swift-2.2-SNAPSHOT-2016-01-11-a |
ユーザID、パスワードに誤りがないか確認してください。
また、半角文字列で入力されていることを確認してください。
TwitterのAtCoderアカウントにリプライしていただけるとありがたいです。
常に監視しているわけではありませんが、できるだけ迅速に対応させて頂きます。