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 = "\ | |
p=<1609,-863,-779>, v=<-15,54,-69>, a=<-10,0,14> | |
p=<-391,1353,-387>, v=<-94,-42,0>, a=<14,-5,3> | |
p=<3329,-143,333>, v=<-29,9,-45>, a=<-21,0,3> | |
p=<1751,3779,3413>, v=<-8,-57,-80>, a=<-5,-8,-5> | |
p=<-3241,1019,17>, v=<75,8,-26>, a=<5,-4,2> | |
p=<-1333,3071,2369>, v=<133,-15,51>, a=<-6,-9,-12> | |
p=<-3961,-2905,-1111>, v=<-20,59,46>, a=<15,5,0> | |
p=<-109,2663,-3655>, v=<7,-48,102>, a=<0,-5,4> | |
p=<-4417,2387,2021>, v=<99,-149,-72>, a=<7,4,-1> |
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 = "\ | |
p=<1609,-863,-779>, v=<-15,54,-69>, a=<-10,0,14> | |
p=<-391,1353,-387>, v=<-94,-42,0>, a=<14,-5,3> | |
p=<3329,-143,333>, v=<-29,9,-45>, a=<-21,0,3> | |
p=<1751,3779,3413>, v=<-8,-57,-80>, a=<-5,-8,-5> | |
p=<-3241,1019,17>, v=<75,8,-26>, a=<5,-4,2> | |
p=<-1333,3071,2369>, v=<133,-15,51>, a=<-6,-9,-12> | |
p=<-3961,-2905,-1111>, v=<-20,59,46>, a=<15,5,0> | |
p=<-109,2663,-3655>, v=<7,-48,102>, a=<0,-5,4> | |
p=<-4417,2387,2021>, v=<99,-149,-72>, a=<7,4,-1> |
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; | |
const INPUT: &[u8] = b" | |
| | |
+-------------------------------------------------------------------------------------------------------+ +-+ +---------------------------------------|-------------+ | |
| | | | | | | | |
| +-+ +-------+ +-------------------------------------------------------------------+ +-----------|-----+ +-----+ +---+ | +-+ +---|-+ | |
| | | | | | | | | | | |
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; | |
const INPUT: &[u8] = b" | |
| | |
+-------------------------------------------------------------------------------------------------------+ +-+ +---------------------------------------|-------------+ | |
| | | | | | | | |
| +-+ +-------+ +-------------------------------------------------------------------+ +-----------|-----+ +-----+ +---+ | +-+ +---|-+ | |
| | | | | | | | | | | |
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_1: &str = "\ | |
set a 1 | |
add a 2 | |
mul a a | |
mod a 5 | |
snd a | |
set a 0 | |
rcv a |
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: usize = 3; | |
const INPUT: usize = 369; | |
fn main() { | |
let mut after_0 = None; | |
let mut pos = 0; | |
let mut buffer_len = 1; | |
for new_val in 1..50000001 { | |
pos = (pos + INPUT) % buffer_len; |
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: usize = 3; | |
const INPUT: usize = 369; | |
fn main() { | |
let mut buffer = vec![0]; | |
let mut pos = 0; | |
for new_val in 1..2018 { | |
pos = (pos + INPUT) % buffer.len(); | |
buffer.insert(pos + 1, new_val); |
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: &[u8] = b"59945212267958384861888721899525514753529291453572849834636789447772281393981176491298438538371242283536895511781293535483317797837429153613432291415383346882548197148136644392687919782155536777728388533288353454847112297674777299484733912287764864566862651148756865369264986344956956922521593739716315435946569544941171492946488766611575348519389339547876121464365711831444946799524523259892124812191396861381393149158527746287184435324155247766428771317633594138229866193128628896894723977769686621487531877677937626541334293495153243338777879254655415885849888271366763761288878191616724671425792619954827318789792845732465336888352263526911221698478329435137589241942323459887267417892473791843197823877576131387428178263163762334435218578816782286948636819714454426632514231841776289778999639199975294683549535486129666995267186491327899225845245566977151331633764632562251818332576928213316655326812882169494512768444191542454234341418349139518545512533397855333959498151156228115659992525552349 |
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: &[u8] = b"59945212267958384861888721899525514753529291453572849834636789447772281393981176491298438538371242283536895511781293535483317797837429153613432291415383346882548197148136644392687919782155536777728388533288353454847112297674777299484733912287764864566862651148756865369264986344956956922521593739716315435946569544941171492946488766611575348519389339547876121464365711831444946799524523259892124812191396861381393149158527746287184435324155247766428771317633594138229866193128628896894723977769686621487531877677937626541334293495153243338777879254655415885849888271366763761288878191616724671425792619954827318789792845732465336888352263526911221698478329435137589241942323459887267417892473791843197823877576131387428178263163762334435218578816782286948636819714454426632514231841776289778999639199975294683549535486129666995267186491327899225845245566977151331633764632562251818332576928213316655326812882169494512768444191542454234341418349139518545512533397855333959498151156228115659992525552349 |
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_1: &str = "\ | |
5 1 9 5 | |
7 5 3 | |
2 4 6 8\ | |
"; | |
const _INPUT_2: &str = "\ | |
5 9 2 8 | |
9 4 7 3 | |
3 8 6 5\ |