예제 #1
0
        /// <summary>
        /// https://adventofcode.com/2020/day/14#part2
        /// </summary>
        public static void Part2()
        {
            var computer = new SeaPortComputer();
            var program  = SeaPortProgram.Parse(Input.Get(14));

            computer.Run(program, true);

            Console.WriteLine(Sum(computer));
        }
예제 #2
0
 public static BigInteger Sum(SeaPortComputer computer)
 {
     return(computer.Memory.Aggregate(BigInteger.Zero, (x, y) => x + y.Value));
 }