[TOPSIC PG] Rules / terms

Examination rules

Language

The programming language for solving the problem is limited to those that TOPSIC system supports. The following is a table of supported languages. AtCoder Library(AC Library, ACL) is available in C++. For more information about the installed libraries for each language, please click here.

LanguageCompile, Interpreter / Execution Command
C++ 20 (gcc 12.2)
g++-12 -std=gnu++20 -O2 -DONLINE_JUDGE -DATCODER \
 -Wall -Wextra \
 -mtune=native -march=native \
 -fconstexpr-depth=2147483647 -fconstexpr-loop-limit=2147483647 -fconstexpr-ops-limit=2147483647 \
 -I/opt/ac-library -I/opt/boost/gcc/include -L/opt/boost/gcc/lib \
 -o a.out Main.cpp \
 -lgmpxx -lgmp \
 -I/usr/include/eigen3
/a.out
Go (go 1.20.6)
export PATH=$PATH:/opt/go/bin
go build -o a.out
/a.out
C# 11.0 (.NET 7.0.7)
export DOTNET_EnableWriteXorExecute=0
dotnet publish -c Release -o publish -v q --nologo 1>&2
/publish/Main
Kotlin (Kotlin/JVM 1.8.20)
$HOME/.sdkman/candidates/kotlin/current/bin/kotlinc ./Main.kt -include-runtime -jvm-target 19 -d ./Main.jar
usr/lib/jvm/java-19-openjdk-amd64/bin/java -cp ./Main.jar -Xss{memory:mb}M -DONLINE_JUDGE=true MainKt
Java (OpenJDK 17)
javac Main.java
ava -Xss{memory:mb}M -DONLINE_JUDGE=true Main
Nim (Nim 1.6.14)
export PATH=$HOME/.nimble/bin:$PATH
nim cpp -d:release --opt:speed --multimethods:on --warning[SmallLshouldNotBeUsed]:off --hints:off -o:a.out Main.nim
/a.out
V (V 0.4)
v -prod -cc clang -skip-unused -manualfree -prealloc -gc none -no-bounds-checking -o a.out Main.v
/a.out
Zig (Zig 0.10.1)
zig build
/zig-out/bin/a.out
JavaScript (Node.js 18.16.1)
node --check Main.js && touch ok
ode --stack-size={memory:kb} Main.js ONLINE_JUDGE ATCODER
JavaScript (Deno 1.35.1)
export NO_COLOR=true
export PATH=$PATH:/home/runner/.deno/bin
export DENO_NO_UPDATE_CHECK=1

# キャッシュしつつ、import・構文などをチェック
if deno cache --quiet Main.js > check-output 2>&1 ; then
    touch ok
else
  cat check-output 1>&2
  if grep -q "error sending request for url (http" check-output 2>/dev/null; then
    # ライブラリをダウンロードしようとした場合はヒントを表示
    echo "---" 1>&2
    echo "Tips from the judge system: The only available external libraries are:" 1>&2
    echo "- std@0.194.0" 1>&2
    echo "- npm:mathjs@11.8.2" 1>&2
    echo "Please make sure to specify the version number when importing." 1>&2
  fi
fi
eno run --allow-all --quiet --no-prompt --v8-flags=--stack-size={memory:kb} Main.js ONLINE_JUDGE ATCODER
R (GNU R 4.2.1)
Rscript Main.R < /dev/null &> /dev/null
Rscript -e "parse('Main.R')" && touch a.out
script Main.R
D (DMD 2.104.0)
export DFLAGS="-O -release -boundscheck=off"
dub build --skip-registry=all --nodeps
/judge
D (LDC 1.32.2)
dub build --skip-registry=all --nodeps --build=release-nobounds
/judge
Swift (swift 5.8.1)
export PATH=/usr/local/swift/usr/bin:$PATH
swift build -Xswiftc -O -Xlinker -lm -c release 1>&2
/.build/release/Main
Dart (Dart 3.0.5)
dart compile exe Main.dart -o a.out
/a.out
PHP (php 8.2.8)
# チェックで問題が無かった場合OKファイルを生成
php -l Main.php && touch OK
hp Main.php
C (gcc 12.2.0)
gcc-12 -std=gnu2x -O2 -DONLINE_JUDGE -DATCODER -o a.out Main.c -lm
/a.out
Ruby (ruby 3.2.2)
ruby -c Main.rb && touch syntax_ok
uby --jit --yjit-exec-mem-size=128 Main.rb
Crystal (Crystal 1.9.1)
cd main && shards build --release --no-debug --no-color -Donline_judge 1>&2
/main/bin/main
F# 7.0 (.NET 7.0.7)
export DOTNET_EnableWriteXorExecute=0
dotnet publish -c Release -o publish -v q --nologo 1>&2
/publish/Main
Julia (Julia 1.9.2)
export PATH=$PATH:/home/runner/.juliaup/bin
julia -e "Meta.parse(\"begin \" * read(\"Main.jl\",String) * \" end\")" && touch ok
julia Main.jl ONLINE_JUDGE 2> /dev/null
ulia Main.jl
Bash (bash 5.2.2)
bash -n Main.bash || rm Main.bash
ash Main.bash
Text (cat 8.32)
at Main.text
Haskell (GHC 9.4.5)
cd submission
source ~/.ghcup/env
cabal v2-build --offline && cp $(cabal list-bin main) ../
/main
Fortran (gfortran 12.2)
export FFLAGS="-O2 -std=f2018"
cmake -B build -DCMAKE_BUILD_TYPE=NoConfig
cmake --build build
/build/main
Lua (LuaJIT 2.1.0-beta3)
luajit -O3 -b Main.lua luac.out
uajit -O3 luac.out
C++ 23 (gcc 12.2)
g++-12 -std=gnu++2b -O2 -DONLINE_JUDGE -DATCODER \
 -Wall -Wextra \
 -mtune=native -march=native \
 -fconstexpr-depth=2147483647 -fconstexpr-loop-limit=2147483647 -fconstexpr-ops-limit=2147483647 \
 -I/opt/ac-library -I/opt/boost/gcc/include -L/opt/boost/gcc/lib \
 -o a.out Main.cpp \
 -lgmpxx -lgmp \
 -I/usr/include/eigen3
/a.out
Common Lisp (SBCL 2.3.6)
export SBCL_HOME=/usr/local/lib/sbcl
./sbcl --noinform --eval '(compile-file "Main.lisp")' --quit
if [ -f Main.fasl ]; then
  chmod +x Main.fasl
fi
/Main.fasl
COBOL (Free) (GnuCOBOL 3.1.2)
cobc -x -free -O2 -o ./a.out ./Main.cbl
/a.out
C++ 23 (Clang 16.0.6)
clang++ -std=c++2b -Wall -Wextra -O2 -DONLINE_JUDGE -DATCODER -mtune=native -march=native -fconstexpr-depth=2147483647 -fconstexpr-steps=2147483647 -I/opt/boost/clang/include -L/opt/boost/clang/lib -I/opt/ac-library -I/usr/include/eigen3 -fuse-ld=lld -o ./a.out ./Main.cpp
/a.out
Zsh (Zsh 5.9)
zsh -n Main.zsh || rm Main.zsh
sh Main.zsh
SageMath (SageMath 9.5)
sage --preparse Main.sage && python3 -m py_compile Main.sage.py || rm Main.sage.py
ython3 Main.sage.py
Sed (GNU sed 4.8)
ed -f Main.sed
bc (bc 1.07.1)
c --mathlib Main.bc
dc (dc 1.07.1)
c -f Main.dc
Perl (perl 5.34)
perl -c Main.pl && touch ok
erl Main.pl
AWK (GNU Awk 5.0.1)
wk -f Main.awk
なでしこ (cnako3 3.4.20)
cnako3 -c Main.nako3
ode --stack-size={memory:kb} Main.mjs
Assembly x64 (NASM 2.15.05)
nasm -f elf64 Main.asm && gcc -o a.out Main.o -lm
/a.out
Pascal (fpc 3.2.2)
fpc -O2 -Sd -Sh -v0z -oa.out Main.p
/a.out
C# 11.0 AOT (.NET 7.0.7)
export DOTNET_EnableWriteXorExecute=0
dotnet publish -c Release -o publish -v q --nologo 1>&2
/publish/Main
Lua (Lua 5.4.6)
export PATH=$PATH:/judge/lua-5.4.6/src
luac -o luac.out Main.lua
ua luac.out
Prolog (SWI-Prolog 9.0.4)
swipl -O -g main -o a.out -c Main.pl
# source 内で main :-
/a.out
PowerShell (PowerShell 7.3.1)
wsh ./Main.ps1
Scheme (Gauche 0.9.12)
osh ./Main.scm
Scala 3.3.0 (Scala Native 0.4.14)
cd main && sbt "set offline := true" nativeLink 1>&2
/main/target/scala-3.3.0/main-out
Visual Basic 16.9 (.NET 7.0.7)
export DOTNET_EnableWriteXorExecute=0
dotnet publish -c Release -o publish -v q --nologo 1>&2
/publish/Main
Forth (gforth 0.7.3)
forth-fast Main.fs -e bye
Clojure (babashka 1.3.181)
b Main.clj
Erlang (Erlang 26.0.2)
export PATH=/home/runner/.asdf/installs/erlang/26.0.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
erlc Main.erl 1>&2
rl -noshell -run Main main run
TypeScript 5.1 (Deno 1.35.1)
export NO_COLOR=true
export DENO_NO_UPDATE_CHECK=1
export PATH=$PATH:/home/runner/.deno/bin

# キャッシュしつつ、import・型・構文などをチェック
if deno cache --quiet --check Main.ts > check-output 2>&1 ; then
    touch ok
else
  cat check-output 1>&2
  if grep -q "error sending request for url (http" check-output 2>/dev/null; then
    # ライブラリをダウンロードしようとした場合はヒントを表示
    echo "---" 1>&2
    echo "Tips from the judge system: The only available external libraries are:" 1>&2
    echo "- std@0.194.0" 1>&2
    echo "- npm:tstl@2.5.13" 1>&2
    echo "- npm:mathjs@11.8.2" 1>&2
    echo "Please make sure to specify the version number when importing." 1>&2
  fi
fi
eno run --allow-all --quiet --no-prompt --v8-flags=--stack-size={memory:kb} Main.ts ONLINE_JUDGE ATCODER
C++ 17 (gcc 12.2)
g++ -std=gnu++17 -Wall -Wextra -O2 -DONLINE_JUDGE -I/opt/boost/gcc/include -L/opt/boost/gcc/lib -I/opt/ac-library -o a.out Main.cpp
/a.out
Rust (rustc 1.70.0)
cargo build --release --quiet --offline
/target/release/main
Python (CPython 3.11.4)
python3.11 -m py_compile Main.py
python3.11 Main.py ONLINE_JUDGE 2> /dev/null
ython3.11 Main.py
Scala (Dotty 3.3.0)
scala-cli --power package --bloop-jvm system --jvm system -S 3.3.0 Main.scala -o Main --assembly 2>&1 | ansifilter 1>&2
/Main
Koka (koka 2.4.0)
koka -O2 -o a.out Main.kk 1>&2
if [ -f a.out ]; then chmod +x a.out; fi
/a.out
TypeScript 5.1 (Node.js 18.16.1)
tsc Main.ts --target ESNext --moduleResolution node --module commonjs --noEmitOnError --pretty true | ansifilter 1>&2
ode --stack-size={memory:kb} Main.js ONLINE_JUDGE ATCODER
OCaml (ocamlopt 5.0.0)
eval $(opam env) ocamlfind ocamlopt -O2 -o a.out \
main.ml -linkpkg -thread \
-package str,num,threads,containers,core,iter,batteries
/a.out
Raku (Rakudo 2023.06)
export PATH=/opt/rakudo-pkg/bin:$PATH
export RAKUDO_ERROR_COLOR=0
raku -c Main.p6 && touch ok
aku Main.p6
Vim (vim 9.0.0242)
ash -c cat - > /tmp/out; TERM=dumb vim -N -u NONE -i NONE -s Main.vim /tmp/out > /dev/null 2>&1; cat /tmp/out
Emacs Lisp (Native Compile) (GNU Emacs 28.2)
emacs --batch -f package-initialize --eval '(native-compile "Main.el" (expand-file-name "Main.eln"))'
macs --batch -f package-initialize -l Main.eln
Python (Mambaforge / CPython 3.10.10)
~/mambaforge/bin/python3.10 Main.py ONLINE_JUDGE 2> /dev/null
home/runner/mambaforge/bin/python3.10 Main.py
Clojure (clojure 1.11.1)
lojure -J-Xss{memory:mb}M -M Main.clj
プロデル (mono版プロデル 1.9.1182)
mono produire-mono/rdrc.exe /mono /console produire-mono/Main.rdr > compile-out
result=$(tail -1 compile-out)
if [ "$result" = "失敗しました。" ]; then
  rm produire-mono/Main.exe
  cat compile-out 1>&2
fi
ono produire-mono/Main.exe
ECLiPSe (ECLiPSe 7.1_13)
export PATH=$PATH:/judge/eclipse/bin/x86_64_linux
echo "compile('Main.ecl', [output: eco, debug: off])" | eclipse -f Main.ecl
clipse -f Main.eco -e main
Nibbles (literate form) (nibbles 1.01)
./nibbles -hs Main.nbl && ~/.ghcup/bin/ghcup --offline run --quick --ghc 8.10.7 -- ghc -O2 out.hs
/out
Ada (GNAT 12.2)
gnat make -O2 -o a.out Main.adb
/a.out
jq (jq 1.6)
q -MrRs -f Main.jq
Cyber (Cyber v0.2-Latest)
if cyber compile Main.cy > compile-out 2>&1; then
  touch ok
else
  cat compile-out 1>&2
fi
yber Main.cy
Carp (Carp 0.5.5)
export CARP_DIR=/opt/carp-v0.5.5-x86_64-linux
carp -b --optimize Main.carp 1>&2
/out/Untitled
C++ 17 (Clang 16.0.6)
clang++ -std=c++17 -Wall -Wextra -O2 -DONLINE_JUDGE -DATCODER -mtune=native -march=native -fconstexpr-depth=2147483647 -fconstexpr-steps=2147483647 -I/opt/boost/clang/include -L/opt/boost/clang/lib -I/opt/ac-library -I/usr/include/eigen3 -fuse-ld=lld -o ./a.out ./Main.cpp
/a.out
C++ 20 (Clang 16.0.6)
clang++ -std=c++20 -Wall -Wextra -O2 -DONLINE_JUDGE -DATCODER -mtune=native -march=native -fconstexpr-depth=2147483647 -fconstexpr-steps=2147483647 -I/opt/boost/clang/include -L/opt/boost/clang/lib -I/opt/ac-library -I/usr/include/eigen3 -fuse-ld=lld -o ./a.out ./Main.cpp
/a.out
LLVM IR (Clang 16.0.6)
clang-16 -O2 -o ./a.out ./Main.ll
/a.out
Emacs Lisp (Byte Compile) (GNU Emacs 28.2)
emacs --batch -f package-initialize -f batch-byte-compile Main.el
macs --batch -f package-initialize -l Main.elc
Factor (Factor 0.98)
opt/factor/factor Main.factor
D (GDC 12.2)
dub build --skip-registry=all --nodeps --build=release-nobounds
/judge
Python (PyPy 3.10-v7.3.12)
pypy3 -m py_compile Main.py
pypy3 Main.py ONLINE_JUDGE 2> /dev/null
ypy3 Main.py
><> (fishr 0.1.0)
ishr Main.fish
ReasonML (reason 3.9.0)
cd main
eval $(opam env)
dune build --release
/main/_build/default/bin/main.exe
Python (Cython 0.29.34)
python3.11 -c "from Cython.Build import cythonize;from Cython.Compiler import Options;Options.embed='main';cythonize('Main.pyx', language='c++', compiler_directives={'language_level':'3'})"
g++ -Wno-deprecated-declarations -O2 -fPIC -I/usr/local/include/python3.11 -I$HOME/.local/lib/python3.11/site-packages/numpy/core/include -o a.out Main.cpp -lpython3.11
/a.out
Octave (GNU Octave 8.2.0)
octave -W --eval 'disp("Hello, world!")'
ctave -W Main.m
Haxe (JVM) (Haxe 4.3.1)
export PATH=/opt/haxe_20230428195743_964c84c:$PATH
haxe -D analyzer-optimize --jvm Main.jar --main Main
ava -jar Main.jar
Elixir (Elixir 1.15.2)
export PATH=/home/runner/.asdf/installs/erlang/26.0.2/bin:/opt/elixir/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
mix compile
ix run -e Main.main
Mercury (Mercury 22.01.6)
mmc -o a.out -O 5 main
/a.out
Seed7 (Seed7 3.2.1)
s7c -O2 -oc3 Main.sd7 1>&2
/Main
Emacs Lisp (No Compile) (GNU Emacs 28.2)
macs --batch -f package-initialize -l Main.el
Unison (Unison M5b)
sh -c "echo 'load main.u'; sleep 5 ; echo 'add'" | /opt/ucm/ucm > compile-out
echo 'compile main main' | /opt/ucm/ucm
if [ ! -f main.uc ]; then
  cat compile-out | ansifilter 1>&2
fi
opt/ucm/ucm run.compiled main.uc
COBOL (GnuCOBOL(Fixed) 3.1.2)
cobc -x -O2 -o ./a.out ./Main.cbl
/a.out

Language notes

When using C or C++, specify the type of main function as int and return 0;. When using Java, please set the class name to Main. Compiling error occurs in main.


About “state” of submission information

The program submitted by the user is evaluated by the judge system. The following describes the status (status) returned by the system. The following are all incorrect answers.

Label Status Explanation
CE Compilation Error Failed to compile the submitted program.
MLE Memory Limit Exceeded The memory limit specified in the problem has been exceeded.
TLE Time Limit Exceeded The program did not terminate within the execution time specified by the problem.
RE Runtime Error An error occurred while executing the program. There are errors that could not be detected at compile time, due to stack overflow, division by zero, etc.
OLE Output Limit Exceeded We made output of size exceeding the limit specified by problem.
QLE Query Limit Exceeded I have made a query that exceeds the limit specified in the problem.
NG No Good Internal error, ie judge system error.
IE Internal Error Internal error, ie judge system error.
WA Wrong Answer This is an incorrect answer. The output of the submitted program is incorrect.

AC is the only correct answer.

Label Status Explanation
AC Accepted It is correct answer. We passed all the tests prepared by the administration and it was judged to be the correct program.

Moreover, although it is not a wrong answer, it has the following status.

Label Status Explanation
JG Judging It is the state in the judge of the submitted program.
WJ Waiting for Judging) The submitted program is waiting for a judge.

In case there is a mistake in the problem, a rejudge (rejudge) may be performed and the following status will be taken.

Label Status Explanation
WR Waiting for Re-judging We are waiting for a rejudge.

Development environment

Please use the development environment, editor as you like.


TOPSIC Grade

There are 7 grades depending on the level of the examinee.
* These targets examination results you took with submission type “One-shot”.

Assumed rate TOPSIC grade Symbol name Symbol
TOP 1% Diamond
TOP 5% Ruby
TOP 10% Sapphire
TOP 30% Emerald
TOP 50% Gold
TOP 70% Silver
TOP 90% Bronze
- Zero