/competitive-programming

My journey to competitive programming with Rust and AtCoder.

Primary LanguageRust

datahaikuninja/competitive-programing

My journey to competitive programming with Rust and AtCoder.

prerequiste

  1. install rust.

https://www.rust-lang.org/tools/install

  1. add $HOME/.cargo/bin/ to your $PATH env.

  2. setup cargo-atocoder.

  3. add proconio to default dependencies.

vi $HOME/Library/Application Support/cargo-atcoder.toml
# dependencies added to new project
[dependencies]
-# proconio = "*"
+proconio = "*"
# competitive = { git = "https://github.com/tanakh/competitive-rs.git" }
  1. add .gitignore file.

https://github.com/github/gitignore/blob/main/Rust.gitignore

cheatsheet for cargo-atcoder

# login
cargo atcoder login

# enter the contest
# e.g. $ cargo atcoder new abs
cargo atcoder new <contest-name>

# exec testcase
# e.g. $ cargo atcoder test practicea
cargo atcoder test <problem-id>

# exec binary
# e.g. $ cargo run --bin practicea
cargo run --bin <binary>

# submit answer
# e.g. $ cargo atcoder submit practicea
cargo atcoder submit <problem-id>