aboutsummaryrefslogtreecommitdiff
path: root/src/2016/day11/aoc.h
blob: 783c6bff9c9eddb1f8f3b6f9ab394079715a7004 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include "common.h"
#include <vector>

// F4 . .  .  .  .  .  .  .  .  .  .
// F3 . .  .  .  .  .  .  HG HM RG RM
// F2 . .  .  .  PM .  SM .  .  .  .
// F1 E TG TM PG .  SG .  .  .  .  .
//
// F4 .  .  .  .  .
// F3 .  .  .  LG .
// F2 .  HG .  .  .
// F1 E  .  HM .  LM
//
// 0.
// take everythong to the forth floor
//
// 1.
// there is an elevator that can move between the four floors.
// When you enter the containment area, you and the elevator will start on the first floor.
//
// 2.
// Its capacity rating means it can carry at most yourself and two RTGs or microchips in any combination.
//
// 3.
// As a security measure, the elevator will only function if it contains at least one RTG or microchip.
//
// 4.
// The elevator always stops on each floor to recharge,
// Each elevator stop counts as one step, even if nothing is added to or removed from it
//
// 5.
// if a chip is ever left in the same area as another RTG,
// and it's not connected to its own RTG, the chip will be fried.
//

namespace aoc2016 {

struct ritem {
  int fs[2] = {0, 0}; // 0 Gen, 1 Chip, value floor

  ritem(int fg, int fc) {
    fs[0] = fg;
    fs[1] = fc;
  }
};

std::pair<int64_t, int64_t> day11(line_view);
} // namespace aoc2016