Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/icyjoseph/codejam-js
Solutions to Code Jam and Kick Start problems.
https://github.com/icyjoseph/codejam-js
algorithm-challenges babel codeforces codejam competitive-programming es6 javascript kickstart rust swift
Last synced: 2 months ago
JSON representation
Solutions to Code Jam and Kick Start problems.
- Host: GitHub
- URL: https://github.com/icyjoseph/codejam-js
- Owner: icyJoseph
- Created: 2019-03-16T07:16:19.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-11-08T13:22:36.000Z (about 2 years ago)
- Last Synced: 2024-05-02T05:58:15.509Z (9 months ago)
- Topics: algorithm-challenges, babel, codeforces, codejam, competitive-programming, es6, javascript, kickstart, rust, swift
- Language: Rust
- Homepage:
- Size: 356 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Competitive Programming
This repository features solutions to Google's competitions and Codeforces using Rust.
## Content
Solutions to Kick Start Problems, Codeforces and CodeJam are all mixed up in the `src/` folder.
## Quick start
In this competitions speed is everything, that's why there's a file, `template/src/main.src`, which can be used to start solving a problem.
It contains number parsing, and vector parsing for `i32`, `usize`, `u32`, etc. All generics that implement `FromStr`.
It is also possible to simply read the next line, as a `String`, using `nxt`.
### Toolbox
#### `nxt`
Reads a line from `stdin` and returns it as a `String`.
```rust
fn main() -> Res<()> {
let string = nxt();
println!("{}", string);
}
```#### `parse_num`
Builds upon `nxt`, to parse a line as a number into type `T: std::str::FromStr`.
```rust
fn main() -> Res<()> {
let num = parse_num::();
println!("{}", num);
}
```#### `parse_vec`
Builds upon `nxt`, to parse a line as a vector of type `T: std::str::FromStr`.
```rust
fn main() -> Res<()> {
let vector = parse_vec::();
println!("{:?}", vector);
}
```## Creating a new problem
Enter to the `src` folder and run:
```
cargo generate --path ./template --name --force
```## Solving a problem
Place your solution inside the `main` function. Create as many helpers as necessary.
## Run a problem
From the problem directory:
```
cargo build --release --target-dir .
./release/ < .in
```## Legacy
### CodeJam 2019
Solved enough to pass to next round. My two solutions worked flawlessly on the first attempt, and also passed the hidden test cases.
After the qualification, as practice, I solved problem 3, `Cryptopangrams`, inside the `cypher.js` file. Problem 4 is also solved in `datbae.js`, very tough problem!
### Transpiling
> CodeJam 2019 has enabled nodejs v11.13.0!
To use JavaScript transpiling checkout the v1 tag.