advent-of-code/python/2023/README.org

68 lines
1.3 KiB
Org Mode
Raw Normal View History

2023-12-01 11:43:15 -05:00
* Advent of Code Python
2023-12-01 12:53:26 -05:00
** 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
2023-12-02 11:05:05 -05:00
** 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
2023-12-04 11:13:18 -05:00
** 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
2023-12-04 11:28:43 -05:00
where =avg-time= is [[https://stackoverflow.com/a/54920339][this bit of ~awk~]]
2023-12-04 11:13:18 -05:00
*** Answers
19135
5704953
2023-12-07 20:59:47 -05:00
** 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