67 lines
1.3 KiB
Org Mode
67 lines
1.3 KiB
Org Mode
* Advent of Code Python
|
|
** Day 1
|
|
|
|
#+begin_src shell
|
|
source ~/virtualenvs/aoc-2023/bin/activate
|
|
cd ~/git/advent-of-code/python/2023
|
|
python src/andy_aoc_2023/day1.py src/andy_aoc_2023/day1_big
|
|
#+end_src
|
|
|
|
*** Answers
|
|
54573
|
|
54591
|
|
** Day 2
|
|
|
|
#+begin_src shell
|
|
source ~/virtualenvs/aoc-2023/bin/activate
|
|
cd ~/git/advent-of-code/python/2023
|
|
python src/andy_aoc_2023/day2.py src/andy_aoc_2023/day2_big
|
|
#+end_src
|
|
|
|
*** Answers
|
|
2600
|
|
86036
|
|
|
|
** Day 4
|
|
|
|
#+begin_src shell
|
|
source ~/virtualenvs/aoc-2023/bin/activate
|
|
cd ~/git/advent-of-code/python/2023
|
|
python src/andy_aoc_2023/day4.py src/andy_aoc_2023/day4_big
|
|
#+end_src
|
|
|
|
Warning: Part 2 is a little slow
|
|
|
|
#+begin_src shell
|
|
~/bin/avg-time 5 python src/andy_aoc_2023/day4.py src/andy_aoc_2023/day4_big
|
|
real 8.994000
|
|
user 8.982000
|
|
sys 0.008000
|
|
#+end_src
|
|
|
|
where =avg-time= is [[https://stackoverflow.com/a/54920339][this bit of ~awk~]]
|
|
|
|
*** Answers
|
|
19135
|
|
5704953
|
|
|
|
** Day 5
|
|
*** Answers
|
|
324724204
|
|
104070862
|
|
|
|
#+begin_src shell
|
|
-> date -Iseconds; cat src/andy_aoc_2023/BIG_INPUTS | xargs -P 0 -I '%' python src/andy_aoc_2023/day5.py src/andy_aoc_2023/BIG_MAPS %; date -Iseconds
|
|
2023-12-05T12:55:55-05:00
|
|
856496588
|
|
547766656
|
|
990928320
|
|
104899384
|
|
516299014
|
|
104070862 <-- This is the min aka the answer
|
|
324724204
|
|
344671053
|
|
114257961
|
|
146071405
|
|
2023-12-05T14:46:41-05:00
|
|
#+end_src
|