RULES

The ground rules for fierce strategic competition Fair competition starts with clear standards.

ROOKIE TRACKMASTER TRACK

Contest Rules

Dev Tools Guide

You may use the development tools on your local computer while writing code. In this case, please be sure to read this guide so that you do not suffer the disadvantage of your code failing to run or be judged due to differences between your local development environment and the judging environment (especially when using Visual Studio / Visual C++).

Judging Environment

The execution and judging of all code submitted for code submission problems takes place in the following environment.

  • Amazon Web Services c7a.2xlarge instance
  • Custom processor based on 4th-generation AMD EPYC
  • Clock: 3.7 GHz
  • Processor architecture: 64-bit
  • OS: Ubuntu 24.04

Please note that code that does not work in this environment will not be graded. Please keep this in mind when using development tools.

Compilers by Language

Compilers by Language
C20
c20
gcc 14.2.0
Available libraries
(none)
Compile command
gcc -std=gnu2x -O2 -DONLINE_JUDGE -DNYPC -Wall -Wextra -march=native -mtune=native -o main main.c -lm
Run command
./main NYPC
C++20
cpp20
gcc 14.2.0
Available libraries
Compile command
g++ -std=gnu++20 -O2 -DONLINE_JUDGE -DNYPC -Wall -Wextra -march=native -mtune=native -o main main.cpp -I/opt/boost/gcc/include -L/opt/boost/gcc/lib
Run command
./main NYPC
Python3
python3
Python 3.12.3
Compile command
python3 -m py_compile main.py
Run command
python3 **pycache**/main.cpython-312.pyc NYPC
Pypy3
pypy3
Python 3.9.18 (Pypy 7.3.15)
Compile command
pypy3 -m py_compile main.py
Run command
pypy3 **pycache**/main.pypy39.pyc NYPC
Java 25
java25
openjdk 25.0.7
Available libraries
(none)
Compile command
javac --release 25 -encoding UTF-8 Main.java -d out && jar cfe Main.jar Main -C out .
Run command
java -Xms<memory> -Xmx<memory> -DONLINE_JUDGE=1 -DNYPC=1 -jar Main.jar NYPC
Rust 2024
rust2024
rustc 1.93.1
Compile command
cargo rustc -r -q --frozen -- -Copt-level=3 -Ctarget-cpu=native --cfg online_judge --cfg nypc
Run command
./target/release/main NYPC
Node.js
nodejs24
Node.js v24.13.1
Available libraries
(none)
Compile command
(No compilation)
Run command
node main.js NYPC
Typescript 5.9.3
nodets24
Typescript 5.9.3 (Node.js v24.13.1)
Available libraries
Compile command
tsc main.ts --target ESNext --moduleResolution node --module commonjs --noEmitOnError
Run command
node main.js NYPC
C# 10
csharp10
dotnet 10.0.103
Available libraries
Compile command
dotnet publish -r linux-x64 -p:PublishSingleFile=true -p:DefineConstants="ONLINE_JUDGE;NYPC" --no-restore -c Release --sc true
Run command
./bin/Release/net10.0/linux-x64/publish/Main NYPC
Go
golang126
go 1.26.0
Compile command
go build -mod vendor -o main main.go
Run command
./main NYPC
LuaJIT
luajit
Lua 5.1 (LuaJIT 2.1.1748459687)
Available libraries
(none)
Compile command
luajit -O3 -b Main.lua Main.out
Run command
/usr/local/bin/luajit Main.out NYPC
Lua 5.4
lua
Lua 5.4.6
Available libraries
(none)
Compile command
/usr/bin/luac5.4 -o Main.out Main.lua
Run command
lua5.4 Main.out NYPC
Kotlin JVM 2.3
kotlinjvm
kotlinc-jvm 2.3.10
Available libraries
(none)
Compile command
kotlinc -include-runtime -d Main.jar Main.kt
Run command
java -Xms<memory> -Xmx<memory> -DONLINE_JUDGE=1 -DNYPC=1 -jar Main.jar NYPC
Scala JVM 3.8
scala3jvm
scala 3.8.1
Available libraries
(none)
Compile command
scalac -d Main.jar Main.scala
Run command
java -Xms<memory> -Xmx<memory> -DONLINE_JUDGE=1 -DNYPC=1 -cp /root/.sdkman/candidates/scala/3.8.1/lib/scala/jar:Main.jar Main NYPC
C++26
cpp-exp
gcc 15
Available libraries
Compile command
g++-15 -std=gnu++26 -O2 -DONLINE_JUDGE -DNYPC -Wall -Wextra -march=native -mtune=native -o main main.cpp -I/opt/boost/gcc/include -L/opt/boost/gcc/lib
Run command
./main NYPC
Rust 2024 Nightly
rust-exp
rustc >=1.95.0-nightly
Compile command
cargo rustc -r -q --frozen -- -Copt-level=3 -Ctarget-cpu=native --cfg online_judge --cfg nypc
Run command
./target/release/main NYPC
  • C++26 and Rust 2024 Nightly are experimental languages whose judging and compilation environments may change at any time, and their correct operation is not guaranteed.

Cautions

Please be careful not to write code that runs only on a specific platform (especially Windows or Visual C++), as in the examples below.

Prohibited ExampleRemarks
void main()it must be int main
getch()Use getchar() instead
fflush(stdin)Use of a non-standard function
GetTickCount()The Windows API cannot be used
CStringCString is non-standard and cannot be used. Use std::string instead
#include <stdafx.h>stdafx.h is a Visual C++-only precompiled header

Java Cautions

The class name must be Main.

Using Standard Input/Output

For all code submission problems, you must read input from standard input according to the given input format and print output to standard output according to the given output format. If there is a problem in which you must read two integers and print their product, as in the example below, the way to handle standard input and standard output for each language is as follows.

Input Example

8 4

Output Example

32

Code Examples by Language

C20
#include <stdio.h>

int main()
{
	int a, b;
	scanf("%d %d", &a, &b);
	printf("%d\n", a * b);
	return 0;
}
C++20
#include <iostream>

using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	cout << a * b << endl;
	return 0;
}
Python3
a, b = map(int, input().split())
print(a * b)
Pypy3
a, b = map(int, input().split())
print(a * b)
Java 25
import java.util.Scanner;
public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println(a * b);
    }
}
Rust 2024
use std::io;
fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    let nums: Vec<i32> = input.trim().split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect();
    println!("{}", nums[0] * nums[1]);
}
Node.js
const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const [a, b] = input.split(' ').map(Number);
console.log(a * b);
Typescript 5.9.3
const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const [a, b] = input.split(' ').map(Number);
console.log(a * b);
C# 10
using System;
class Program {
    static void Main() {
        string[] input = Console.ReadLine().Split(' ');
        int a = int.Parse(input[0]);
        int b = int.Parse(input[1]);
        Console.WriteLine(a * b);
    }
}
Go
package main
import (
    "fmt"
)
func main() {
    var a, b int
    fmt.Scanf("%d %d", &a, &b)
    fmt.Println(a * b)
}
LuaJIT
a, b = io.read("*n", "*n")
print(a * b)
Lua 5.4
a, b = io.read("*n", "*n")
print(a * b)
Kotlin JVM 2.3
fun main() {
    val (a, b) = readLine()!!.split(" ").map { it.toInt() }
    println(a * b)
}
Scala JVM 3.8
import scala.io.StdIn.readLine

@main def run(): Unit =
  val nums = readLine().split(" ").map(_.toInt)
  println(nums(0) * nums(1))

Binary Files

In the judging environment, you may submit a binary file in addition to your source code. The binary file is provided as a file named data.bin in the directory where the source code is executed. This file is provided only during code execution, not during compilation. The code to print every byte of data.bin to standard output is as follows.

C20
#include <stdio.h>

int main()
{
    FILE *f = fopen("data.bin", "rb");
    int byte;
    while ((byte = fgetc(f)) != EOF)
    {
        printf("%d ", byte);
    }
    fclose(f);
    printf("\n");
}
C++20
#include <fstream>
#include <iostream>

using namespace std;

int main()
{
    ifstream file("data.bin", ios::binary);

    unsigned char byte;
    while (file.read((char *)&byte, 1))
    {
        cout << (int)byte << " ";
    }
    cout << endl;

    file.close();
    return 0;
}
Python3
with open("data.bin", "rb") as f:
    bytes_read = f.read()
    for byte in bytes_read:
        print(byte, end=" ")
    print()
Pypy3
with open("data.bin", "rb") as f:
    bytes_read = f.read()
    for byte in bytes_read:
        print(byte, end=" ")
    print()
Java 25
import java.io.FileInputStream;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        try (FileInputStream fis = new FileInputStream("data.bin")) {
            int byteRead;
            while ((byteRead = fis.read()) != -1) {
                System.out.print(byteRead + " ");
            }
            System.out.println();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
Rust 2024
use std::{fs::File, io::Read};

fn main() {
    let mut file = File::open("data.bin").unwrap();
    let mut buffer = [0u8; 1];
    while let Ok(n) = file.read(&mut buffer) {
        if n == 0 { break; }
        print!("{} ", buffer[0]);
    }
    println!();
}
Node.js
const fs = require("fs");

fs.readFile("data.bin", (_, data) => {
  data.forEach(byte => process.stdout.write(byte + " "));
  console.log();
});
Typescript 5.9.3
const fs = require("fs");

fs.readFile("data.bin", (_, data) => {
  data.forEach(byte => process.stdout.write(byte + " "));
  console.log();
});
C# 10
using System;
using System.IO;

class Program {
    static void Main() {
        using (FileStream fs = new FileStream("data.bin", FileMode.Open, FileAccess.Read)) {
            int byteRead;
            while ((byteRead = fs.ReadByte()) != -1) {
                Console.Write(byteRead + " ");
            }
            Console.WriteLine();
        }
    }
}
Go
package main

import (
    "fmt"
    "os"
)

func main() {
    file, _ := os.Open("data.bin")
    defer file.Close()

    buf := make([]byte, 1)
    for {
        n, _ := file.Read(buf)
        if n == 0 { break }
        fmt.Printf("%d ", buf[0])
    }
    fmt.Println()
}
LuaJIT
local file = assert(io.open("data.bin", "rb"))

while true do
  local byte = file:read(1)
  if not byte then break end
  io.write(string.byte(byte), " ")
end

file:close()
print()
Lua 5.4
local file = assert(io.open("data.bin", "rb"))

while true do
  local byte = file:read(1)
  if not byte then break end
  io.write(string.byte(byte), " ")
end

file:close()
print()
Kotlin JVM 2.3
import java.io.File

fun main() {
    val bytes = File("data.bin").readBytes()
    for (b in bytes) {
        print("${b.toInt() and 0xFF} ")
    }
    println()
}
Scala JVM 3.8
import java.nio.file.{Files, Paths}

@main def run(): Unit =
  val bytes = Files.readAllBytes(Paths.get("data.bin"))
  println(bytes.map(_ & 0xFF).mkString(" "))

Program Exit Code

The program you write must always have an exit code of 0 (normal termination). If it does not terminate with 0, your submission may not be judged even if it prints the correct answer. In particular, even if you submit code that sets the exit code to 0, it may terminate with a non-zero code depending on whether a runtime error occurs in your program.