This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::cmp::max; | |
const INPUT: &str = "se,ne,se,ne,n,n,n,n,ne,nw,nw,n,nw,nw,sw,sw,sw,sw,sw,sw,sw,sw,s,sw,sw,sw,ne,sw,sw,s,n,s,s,s,s,nw,s,s,s,s,s,se,s,s,n,s,n,se,se,s,se,s,s,s,se,nw,se,se,se,se,se,ne,se,se,se,se,se,n,se,se,se,ne,se,se,se,se,se,se,n,se,se,ne,ne,ne,n,ne,ne,ne,nw,ne,ne,ne,ne,ne,nw,ne,ne,nw,ne,ne,ne,se,ne,ne,ne,sw,se,sw,ne,n,s,sw,ne,n,n,ne,ne,n,ne,ne,n,n,n,n,n,n,se,sw,ne,n,n,n,ne,n,nw,n,ne,ne,ne,n,n,n,n,n,ne,n,ne,sw,nw,ne,sw,nw,n,n,s,nw,n,n,n,n,n,n,n,nw,s,sw,nw,n,se,se,nw,s,nw,nw,nw,nw,nw,se,n,nw,n,s,sw,n,nw,sw,n,nw,se,nw,n,nw,n,nw,sw,n,nw,ne,se,n,nw,ne,nw,nw,se,n,n,nw,nw,se,n,nw,sw,nw,n,n,nw,nw,s,nw,ne,nw,nw,nw,ne,nw,se,n,nw,nw,sw,nw,sw,nw,nw,se,sw,sw,nw,s,nw,nw,nw,nw,sw,n,ne,nw,s,nw,nw,sw,nw,nw,sw,s,nw,nw,nw,se,nw,nw,sw,sw,nw,se,ne,nw,nw,sw,nw,sw,sw,nw,sw,s,sw,sw,sw,sw,nw,n,nw,nw,sw,sw,nw,nw,nw,nw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,nw,sw,sw,se,sw,sw,sw,nw,sw,sw,sw,sw,sw,sw,nw,sw,sw,s,sw,se,sw,sw,sw,ne,n,sw,sw,sw,sw,sw,sw,se,sw,sw,n,sw,sw,s,sw,n,se,s,sw,s,sw,sw,sw,nw,sw,n,s,sw,sw,s,sw,sw,sw,sw,sw,s, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// const STARTING_A: i64 = 65; | |
// const STARTING_B: i64 = 8921; | |
const STARTING_A: i64 = 634; | |
const STARTING_B: i64 = 301; | |
const FACTOR_A: i64 = 16807; | |
const FACTOR_B: i64 = 48271; | |
const DIVISOR_A: i64 = 4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug)] | |
struct Layer { | |
depth: usize, | |
range: usize, | |
} | |
const _SAMPLE_INPUT: &str = "\ | |
0: 3 | |
1: 2 | |
4: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::{HashSet, VecDeque}; | |
const _INPUT: &str = "\ | |
0 <-> 2 | |
1 <-> 1 | |
2 <-> 0, 3, 4 | |
3 <-> 2, 4 | |
4 <-> 2, 3, 6 | |
5 <-> 6 | |
6 <-> 4, 5\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::VecDeque; | |
const _INPUT: &str = "\ | |
0 <-> 2 | |
1 <-> 1 | |
2 <-> 0, 3, 4 | |
3 <-> 2, 4 | |
4 <-> 2, 3, 6 | |
5 <-> 6 | |
6 <-> 4, 5\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _INPUT: &str = "3,4,1,5"; | |
const INPUT: &str = "63,144,180,149,1,255,167,84,125,65,188,0,2,254,229,24"; | |
const SIZE: usize = 256; | |
fn main() { | |
let mut circle: Vec<usize> = (0..SIZE).collect(); | |
let mut pos = 0; | |
let mut skip_size = 0; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _INPUT: &str = "1,2,4"; | |
const INPUT: &str = "63,144,180,149,1,255,167,84,125,65,188,0,2,254,229,24"; | |
const SIZE: usize = 256; | |
const ROUNDS: usize = 64; | |
fn main() { | |
let mut circle: Vec<usize> = (0..SIZE).collect(); | |
let mut pos = 0; | |
let mut skip_size = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(i128_type)] | |
use std::collections::VecDeque; | |
const _INPUT: &str = "flqrgnkx"; | |
const INPUT: &str = "wenycdww"; | |
const SIZE: usize = 256; | |
const ROUNDS: usize = 64; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::str; | |
use self::State::*; | |
enum State { | |
Normal, | |
Escaped, | |
Garbage, | |
} | |
const _INPUT: &str = "{{<!!>},{<!!>},{<!!>},{<!!>}}"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
use std::cmp::Ordering::*; | |
use std::cmp::max; | |
const _INPUT: &str = "\ | |
b inc 5 if a > 1 | |
a inc 1 if b < 5 | |
c dec -10 if a >= 1 | |
c inc -20 if c == 10\ | |
"; |
OlderNewer