diff options
Diffstat (limited to 'src/2017/day20/README.md')
-rw-r--r-- | src/2017/day20/README.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/2017/day20/README.md b/src/2017/day20/README.md index 4e930f2..9583362 100644 --- a/src/2017/day20/README.md +++ b/src/2017/day20/README.md @@ -30,3 +30,30 @@ At this point, particle 1 will never be closer to <0,0,0> than particle 0, and s Which particle will stay closest to position <0,0,0> in the long term? +--- Part Two --- +To simplify the problem further, the GPU would like to remove any particles that collide. Particles collide if their positions ever exactly match. Because particles are updated simultaneously, more than two particles can collide at the same time and place. Once particles collide, they are removed and cannot collide with anything else after that tick. + +For example: + +p=<-6,0,0>, v=< 3,0,0>, a=< 0,0,0> +p=<-4,0,0>, v=< 2,0,0>, a=< 0,0,0> -6 -5 -4 -3 -2 -1 0 1 2 3 +p=<-2,0,0>, v=< 1,0,0>, a=< 0,0,0> (0) (1) (2) (3) +p=< 3,0,0>, v=<-1,0,0>, a=< 0,0,0> + +p=<-3,0,0>, v=< 3,0,0>, a=< 0,0,0> +p=<-2,0,0>, v=< 2,0,0>, a=< 0,0,0> -6 -5 -4 -3 -2 -1 0 1 2 3 +p=<-1,0,0>, v=< 1,0,0>, a=< 0,0,0> (0)(1)(2) (3) +p=< 2,0,0>, v=<-1,0,0>, a=< 0,0,0> + +p=< 0,0,0>, v=< 3,0,0>, a=< 0,0,0> +p=< 0,0,0>, v=< 2,0,0>, a=< 0,0,0> -6 -5 -4 -3 -2 -1 0 1 2 3 +p=< 0,0,0>, v=< 1,0,0>, a=< 0,0,0> X (3) +p=< 1,0,0>, v=<-1,0,0>, a=< 0,0,0> + +------destroyed by collision------ +------destroyed by collision------ -6 -5 -4 -3 -2 -1 0 1 2 3 +------destroyed by collision------ (3) +p=< 0,0,0>, v=<-1,0,0>, a=< 0,0,0> +In this example, particles 0, 1, and 2 are simultaneously destroyed at the time and place marked X. On the next tick, particle 3 passes through unharmed. + +How many particles are left after all collisions are resolved? |