We provide the contestant tools for RECRUIT Nihonbashi Half Marathon 2023 Winter (AHC018).
Please install a compiler for Rust language (see https://www.rust-lang.org).
If a compile error occurs, the compiler version may be old. You can update to the latest compiler by executing the following command.
rustup update
For those who are not familiar with the Rust language environment, we have prepared a pre-compiled binary for Windows.
The following examples assume that you will be working in the directory where this README is located.
The in
directory contains pre-generated input files for seed=0-99.
If you want more inputs, prepare seeds.txt
which contains a list of random seeds (unsigned 64bit integers) and execute the following command.
cargo run --release --bin gen seeds.txt
This will output input files into in
directory.
If you use the precompiled binary for Windows, replace cargo run --release --bin gen
with ./gen.exe
.
By putting space-separetad three integers w
, k
, c
at the end of the each row of seeds.txt
, the values of W
, K
, C
in the generated input can be fixed to w
, k
and c
, respectively.
To fix only some of them, set the values to 0
for the others.
For example, the following seeds.txt
will generate an input with seed=1, W=2, C=128
.
1 2 0 128
Let in.txt
be an input file, out.txt
be a file to which output of your program will be written, and cmd
be a command to run your program. You can test your program by executing the following command.
cargo run --release --bin tester cmd < in.txt > out.txt
The above command outputs the score to standard error. You can specify arguments to your program by
cargo run --release --bin tester cmd arg1 arg2 ... < in.txt > out.txt
If you use the precompiled binary for Windows, replace cargo run --release --bin tester
with ./tester.exe
.
You can visualize the contents of the output file by pasting it into the visualizer.
When executing a binary a.out
which has been compiled in C++, etc.
cargo run --release --bin tester ./a.out < in.txt > out.txt
When executing a program main.py
using python3.
cargo run --release --bin tester python3 main.py < in.txt > out.txt
Because you cannot use <
in the above examples, please execute as follows.
cat in.txt | cargo run --release --bin tester cmd > out.txt
For some execution commands, you may need to specify the full path, as in the following example.
cat in.txt | cargo run --release --bin tester C:\Users\myname\AppData\Local\Microsoft\WindowsApps\python3.exe main.py > out.txt
You can check the full path of a command by executing gcm python3
Let in.txt
be an input file and out.txt
be an output file. You can visualize the output by executing the following command.
cargo run --release --bin vis in.txt out.txt
The above command writes a visualization result to vis.png
. It also outputs the score to standard error.
If you use the precompiled binary for Windows, replace cargo run --release --bin vis
with ./vis.exe
.
You can also use a web visualizer.