aboutsummaryrefslogtreecommitdiff
path: root/src/2015/day19/aoc.cpp
blob: 0d69022a238a1b2e21c497941cd34a8801a6a44d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "aoc.h"

namespace aoc2015 {

std::pair<int, int> day19(line_view file) {
  molecule m;
  per_line(file, [&m](line_view lv) {
    m.parse(lv);
    return true;
  });
  std::map<int, std::vector<molecule::change>> changes;
  m.check(changes);
  int shortest = INT32_MAX;
  // m.deduct(m.original, 0, &shortest);
  m.transfer("e", 0, &shortest);
  return {m.distinct(changes), shortest};
}

} // namespace aoc2015