2018 Day 24 Done
This commit is contained in:
@@ -72,143 +72,242 @@ Advent of Code
|
||||
|
||||
For example, consider the following armies:
|
||||
|
||||
Immune System:
|
||||
17 units each with 5390 hit points (weak to radiation, bludgeoning) with
|
||||
an attack that does 4507 fire damage at initiative 2
|
||||
989 units each with 1274 hit points (immune to fire; weak to bludgeoning,
|
||||
slashing) with an attack that does 25 slashing damage at initiative 3
|
||||
Immune System: 17 units each with 5390 hit points (weak to radiation,
|
||||
bludgeoning) with an attack that does 4507 fire damage at initiative 2 989
|
||||
units each with 1274 hit points (immune to fire; weak to bludgeoning,
|
||||
slashing) with an attack that does 25 slashing damage at initiative 3
|
||||
|
||||
Infection:
|
||||
801 units each with 4706 hit points (weak to radiation) with an attack
|
||||
that does 116 bludgeoning damage at initiative 1
|
||||
4485 units each with 2961 hit points (immune to radiation; weak to fire,
|
||||
cold) with an attack that does 12 slashing damage at initiative 4
|
||||
Infection: 801 units each with 4706 hit points (weak to radiation) with an
|
||||
attack that does 116 bludgeoning damage at initiative 1 4485 units each with
|
||||
2961 hit points (immune to radiation; weak to fire, cold) with an attack that
|
||||
does 12 slashing damage at initiative 4
|
||||
|
||||
If these armies were to enter combat, the following fights, including details during the target selection and attacking phases, would take place:
|
||||
If these armies were to enter combat, the following fights, including
|
||||
details during the target selection and attacking phases, would take place:
|
||||
|
||||
Immune System:
|
||||
Group 1 contains 17 units
|
||||
Group 2 contains 989 units
|
||||
Infection:
|
||||
Group 1 contains 801 units
|
||||
Group 2 contains 4485 units
|
||||
Immune System: Group 1 contains 17 units Group 2 contains 989 units Infection:
|
||||
Group 1 contains 801 units Group 2 contains 4485 units
|
||||
|
||||
Infection group 1 would deal defending group 1 185832 damage
|
||||
Infection group 1 would deal defending group 2 185832 damage
|
||||
Infection group 2 would deal defending group 2 107640 damage
|
||||
Immune System group 1 would deal defending group 1 76619 damage
|
||||
Immune System group 1 would deal defending group 2 153238 damage
|
||||
Immune System group 2 would deal defending group 1 24725 damage
|
||||
Infection group 1 would deal defending group 1 185832 damage Infection group 1
|
||||
would deal defending group 2 185832 damage Infection group 2 would deal
|
||||
defending group 2 107640 damage Immune System group 1 would deal defending
|
||||
group 1 76619 damage Immune System group 1 would deal defending group 2 153238
|
||||
damage Immune System group 2 would deal defending group 1 24725 damage
|
||||
|
||||
Infection group 2 attacks defending group 2, killing 84 units
|
||||
Immune System group 2 attacks defending group 1, killing 4 units
|
||||
Immune System group 1 attacks defending group 2, killing 51 units
|
||||
Infection group 1 attacks defending group 1, killing 17 units
|
||||
Infection group 2 attacks defending group 2, killing 84 units Immune System
|
||||
group 2 attacks defending group 1, killing 4 units Immune System group 1
|
||||
attacks defending group 2, killing 51 units Infection group 1 attacks
|
||||
defending group 1, killing 17 units
|
||||
|
||||
Immune System:
|
||||
Group 2 contains 905 units
|
||||
Infection:
|
||||
Group 1 contains 797 units
|
||||
Immune System: Group 2 contains 905 units Infection: Group 1 contains 797
|
||||
units Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 184904 damage Immune System
|
||||
group 2 would deal defending group 1 22625 damage Immune System group 2 would
|
||||
deal defending group 2 22625 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 4 units Infection
|
||||
group 1 attacks defending group 2, killing 144 units
|
||||
|
||||
Immune System: Group 2 contains 761 units Infection: Group 1 contains 793
|
||||
units Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 183976 damage Immune System
|
||||
group 2 would deal defending group 1 19025 damage Immune System group 2 would
|
||||
deal defending group 2 19025 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 4 units Infection
|
||||
group 1 attacks defending group 2, killing 143 units
|
||||
|
||||
Immune System: Group 2 contains 618 units Infection: Group 1 contains 789
|
||||
units Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 183048 damage Immune System
|
||||
group 2 would deal defending group 1 15450 damage Immune System group 2 would
|
||||
deal defending group 2 15450 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 3 units Infection
|
||||
group 1 attacks defending group 2, killing 143 units
|
||||
|
||||
Immune System: Group 2 contains 475 units Infection: Group 1 contains 786
|
||||
units Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 182352 damage Immune System
|
||||
group 2 would deal defending group 1 11875 damage Immune System group 2 would
|
||||
deal defending group 2 11875 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 2 units Infection
|
||||
group 1 attacks defending group 2, killing 142 units
|
||||
|
||||
Immune System: Group 2 contains 333 units Infection: Group 1 contains 784
|
||||
units Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 181888 damage Immune System
|
||||
group 2 would deal defending group 1 8325 damage Immune System group 2 would
|
||||
deal defending group 2 8325 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 1 unit Infection
|
||||
group 1 attacks defending group 2, killing 142 units
|
||||
|
||||
Immune System: Group 2 contains 191 units Infection: Group 1 contains 783
|
||||
units Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 181656 damage Immune System
|
||||
group 2 would deal defending group 1 4775 damage Immune System group 2 would
|
||||
deal defending group 2 4775 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 1 unit Infection
|
||||
group 1 attacks defending group 2, killing 142 units
|
||||
|
||||
Immune System: Group 2 contains 49 units Infection: Group 1 contains 782 units
|
||||
Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 184904 damage
|
||||
Immune System group 2 would deal defending group 1 22625 damage
|
||||
Immune System group 2 would deal defending group 2 22625 damage
|
||||
Infection group 1 would deal defending group 2 181424 damage Immune System
|
||||
group 2 would deal defending group 1 1225 damage Immune System group 2 would
|
||||
deal defending group 2 1225 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 4 units
|
||||
Infection group 1 attacks defending group 2, killing 144 units
|
||||
Immune System group 2 attacks defending group 1, killing 0 units Infection
|
||||
group 1 attacks defending group 2, killing 49 units
|
||||
|
||||
Immune System:
|
||||
Group 2 contains 761 units
|
||||
Infection:
|
||||
Group 1 contains 793 units
|
||||
Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 183976 damage
|
||||
Immune System group 2 would deal defending group 1 19025 damage
|
||||
Immune System group 2 would deal defending group 2 19025 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 4 units
|
||||
Infection group 1 attacks defending group 2, killing 143 units
|
||||
|
||||
Immune System:
|
||||
Group 2 contains 618 units
|
||||
Infection:
|
||||
Group 1 contains 789 units
|
||||
Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 183048 damage
|
||||
Immune System group 2 would deal defending group 1 15450 damage
|
||||
Immune System group 2 would deal defending group 2 15450 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 3 units
|
||||
Infection group 1 attacks defending group 2, killing 143 units
|
||||
|
||||
Immune System:
|
||||
Group 2 contains 475 units
|
||||
Infection:
|
||||
Group 1 contains 786 units
|
||||
Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 182352 damage
|
||||
Immune System group 2 would deal defending group 1 11875 damage
|
||||
Immune System group 2 would deal defending group 2 11875 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 2 units
|
||||
Infection group 1 attacks defending group 2, killing 142 units
|
||||
|
||||
Immune System:
|
||||
Group 2 contains 333 units
|
||||
Infection:
|
||||
Group 1 contains 784 units
|
||||
Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 181888 damage
|
||||
Immune System group 2 would deal defending group 1 8325 damage
|
||||
Immune System group 2 would deal defending group 2 8325 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 1 unit
|
||||
Infection group 1 attacks defending group 2, killing 142 units
|
||||
|
||||
Immune System:
|
||||
Group 2 contains 191 units
|
||||
Infection:
|
||||
Group 1 contains 783 units
|
||||
Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 181656 damage
|
||||
Immune System group 2 would deal defending group 1 4775 damage
|
||||
Immune System group 2 would deal defending group 2 4775 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 1 unit
|
||||
Infection group 1 attacks defending group 2, killing 142 units
|
||||
|
||||
Immune System:
|
||||
Group 2 contains 49 units
|
||||
Infection:
|
||||
Group 1 contains 782 units
|
||||
Group 2 contains 4434 units
|
||||
|
||||
Infection group 1 would deal defending group 2 181424 damage
|
||||
Immune System group 2 would deal defending group 1 1225 damage
|
||||
Immune System group 2 would deal defending group 2 1225 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 0 units
|
||||
Infection group 1 attacks defending group 2, killing 49 units
|
||||
|
||||
Immune System:
|
||||
No groups remain.
|
||||
Infection:
|
||||
Group 1 contains 782 units
|
||||
Group 2 contains 4434 units
|
||||
Immune System: No groups remain. Infection: Group 1 contains 782 units Group 2
|
||||
contains 4434 units
|
||||
|
||||
In the example above, the winning army ends up with 782 + 4434 = 5216 units.
|
||||
|
||||
You scan the reindeer's condition (your puzzle input); the white-bearded man looks nervous. As it stands now, how many units would the winning army have?
|
||||
You scan the reindeer's condition (your puzzle input); the white-bearded man
|
||||
looks nervous. As it stands now, how many units would the winning army have?
|
||||
|
||||
To begin, get your puzzle input.
|
||||
Your puzzle answer was 16747.
|
||||
|
||||
Answer: _____________________ [ [Submit] ]
|
||||
--- Part Two ---
|
||||
|
||||
Things aren't looking good for the reindeer. The man asks whether more milk
|
||||
and cookies would help you think.
|
||||
|
||||
If only you could give the reindeer's immune system a boost, you might be
|
||||
able to change the outcome of the combat.
|
||||
|
||||
A boost is an integer increase in immune system units' attack damage. For
|
||||
example, if you were to boost the above example's immune system's units by
|
||||
1570, the armies would instead look like this:
|
||||
|
||||
Immune System: 17 units each with 5390 hit points (weak to radiation,
|
||||
bludgeoning) with an attack that does 6077 fire damage at initiative 2 989
|
||||
units each with 1274 hit points (immune to fire; weak to bludgeoning,
|
||||
slashing) with an attack that does 1595 slashing damage at initiative 3
|
||||
|
||||
Infection: 801 units each with 4706 hit points (weak to radiation) with an
|
||||
attack that does 116 bludgeoning damage at initiative 1 4485 units each with
|
||||
2961 hit points (immune to radiation; weak to fire, cold) with an attack that
|
||||
does 12 slashing damage at initiative 4
|
||||
|
||||
With this boost, the combat proceeds differently:
|
||||
|
||||
Immune System: Group 2 contains 989 units Group 1 contains 17 units Infection:
|
||||
Group 1 contains 801 units Group 2 contains 4485 units
|
||||
|
||||
Infection group 1 would deal defending group 2 185832 damage Infection group 1
|
||||
would deal defending group 1 185832 damage Infection group 2 would deal
|
||||
defending group 1 53820 damage Immune System group 2 would deal defending
|
||||
group 1 1577455 damage Immune System group 2 would deal defending group 2
|
||||
1577455 damage Immune System group 1 would deal defending group 2 206618
|
||||
damage
|
||||
|
||||
Infection group 2 attacks defending group 1, killing 9 units Immune System
|
||||
group 2 attacks defending group 1, killing 335 units Immune System group 1
|
||||
attacks defending group 2, killing 32 units Infection group 1 attacks
|
||||
defending group 2, killing 84 units
|
||||
|
||||
Immune System: Group 2 contains 905 units Group 1 contains 8 units Infection:
|
||||
Group 1 contains 466 units Group 2 contains 4453 units
|
||||
|
||||
Infection group 1 would deal defending group 2 108112 damage Infection group 1
|
||||
would deal defending group 1 108112 damage Infection group 2 would deal
|
||||
defending group 1 53436 damage Immune System group 2 would deal defending
|
||||
group 1 1443475 damage Immune System group 2 would deal defending group 2
|
||||
1443475 damage Immune System group 1 would deal defending group 2 97232 damage
|
||||
|
||||
Infection group 2 attacks defending group 1, killing 8 units Immune System
|
||||
group 2 attacks defending group 1, killing 306 units Infection group 1 attacks
|
||||
defending group 2, killing 29 units
|
||||
|
||||
Immune System: Group 2 contains 876 units Infection: Group 2 contains 4453
|
||||
units Group 1 contains 160 units
|
||||
|
||||
Infection group 2 would deal defending group 2 106872 damage Immune System
|
||||
group 2 would deal defending group 2 1397220 damage Immune System group 2
|
||||
would deal defending group 1 1397220 damage
|
||||
|
||||
Infection group 2 attacks defending group 2, killing 83 units Immune System
|
||||
group 2 attacks defending group 2, killing 427 units
|
||||
|
||||
After a few fights...
|
||||
|
||||
Immune System: Group 2 contains 64 units Infection: Group 2 contains 214 units
|
||||
Group 1 contains 19 units
|
||||
|
||||
Infection group 2 would deal defending group 2 5136 damage Immune System group
|
||||
2 would deal defending group 2 102080 damage Immune System group 2 would deal
|
||||
defending group 1 102080 damage
|
||||
|
||||
Infection group 2 attacks defending group 2, killing 4 units Immune System
|
||||
group 2 attacks defending group 2, killing 32 units
|
||||
|
||||
Immune System: Group 2 contains 60 units Infection: Group 1 contains 19 units
|
||||
Group 2 contains 182 units
|
||||
|
||||
Infection group 1 would deal defending group 2 4408 damage Immune System group
|
||||
2 would deal defending group 1 95700 damage Immune System group 2 would deal
|
||||
defending group 2 95700 damage
|
||||
|
||||
Immune System group 2 attacks defending group 1, killing 19 units
|
||||
|
||||
Immune System: Group 2 contains 60 units Infection: Group 2 contains 182 units
|
||||
|
||||
Infection group 2 would deal defending group 2 4368 damage Immune System group
|
||||
2 would deal defending group 2 95700 damage
|
||||
|
||||
Infection group 2 attacks defending group 2, killing 3 units Immune System
|
||||
group 2 attacks defending group 2, killing 30 units
|
||||
|
||||
After a few more fights...
|
||||
|
||||
Immune System: Group 2 contains 51 units Infection: Group 2 contains 40 units
|
||||
|
||||
Infection group 2 would deal defending group 2 960 damage Immune System group
|
||||
2 would deal defending group 2 81345 damage
|
||||
|
||||
Infection group 2 attacks defending group 2, killing 0 units Immune System
|
||||
group 2 attacks defending group 2, killing 27 units
|
||||
|
||||
Immune System: Group 2 contains 51 units Infection: Group 2 contains 13 units
|
||||
|
||||
Infection group 2 would deal defending group 2 312 damage Immune System group
|
||||
2 would deal defending group 2 81345 damage
|
||||
|
||||
Infection group 2 attacks defending group 2, killing 0 units Immune System
|
||||
group 2 attacks defending group 2, killing 13 units
|
||||
|
||||
Immune System: Group 2 contains 51 units Infection: No groups remain.
|
||||
|
||||
This boost would allow the immune system's armies to win! It would be left
|
||||
with 51 units.
|
||||
|
||||
You don't even know how you could boost the reindeer's immune system or what
|
||||
effect it might have, so you need to be cautious and find the smallest boost
|
||||
that would allow the immune system to win.
|
||||
|
||||
How many units does the immune system have left after getting the smallest
|
||||
boost it needs to win?
|
||||
|
||||
Your puzzle answer was 5923.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
|
||||
At this point, you should return to your Advent calendar and try another
|
||||
puzzle.
|
||||
|
||||
If you still want to see it, you can get your puzzle input.
|
||||
|
||||
References
|
||||
|
||||
@@ -228,4 +327,5 @@ References
|
||||
. https://adventofcode.com/2018/stats
|
||||
. https://adventofcode.com/2018/sponsors
|
||||
. https://www.youtube.com/watch?v=NDVjLt_QHL8&t=7
|
||||
. https://adventofcode.com/2018
|
||||
. https://adventofcode.com/2018/day/24/input
|
||||
|
Reference in New Issue
Block a user