summaryrefslogtreecommitdiff
path: root/2018
diff options
context:
space:
mode:
Diffstat (limited to '2018')
-rw-r--r--2018/Cargo.lock89
-rw-r--r--2018/Cargo.toml2
-rw-r--r--2018/input/4.txt1086
-rw-r--r--2018/src/day4.rs134
-rw-r--r--2018/src/main.rs6
5 files changed, 1316 insertions, 1 deletions
diff --git a/2018/Cargo.lock b/2018/Cargo.lock
index 5bf0575..1d233ab 100644
--- a/2018/Cargo.lock
+++ b/2018/Cargo.lock
@@ -1,8 +1,18 @@
[[package]]
+name = "aho-corasick"
+version = "0.6.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "aoc-2018"
version = "0.1.0"
dependencies = [
"argparse 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -10,5 +20,84 @@ name = "argparse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+[[package]]
+name = "cfg-if"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "lazy_static"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "libc"
+version = "0.2.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "memchr"
+version = "2.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
+ "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "regex"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex-syntax 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "thread_local"
+version = "0.3.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "ucd-util"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "utf8-ranges"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "version_check"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
[metadata]
+"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e"
"checksum argparse 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3f8ebf5827e4ac4fd5946560e6a99776ea73b596d80898f357007317a7141e47"
+"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
+"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1"
+"checksum libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)" = "10923947f84a519a45c8fefb7dd1b3e8c08747993381adee176d7a82b4195311"
+"checksum memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a3eb002f0535929f1199681417029ebea04aadc0c7a4224b46be99c7f5d6a16"
+"checksum regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37e7cbbd370869ce2e8dff25c7018702d10b21a20ef7135316f8daecd6c25b7f"
+"checksum regex-syntax 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4e47a2ed29da7a9e1960e1639e7a982e6edc6d49be308a3b02daf511504a16d1"
+"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
+"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86"
+"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737"
+"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
diff --git a/2018/Cargo.toml b/2018/Cargo.toml
index 8c8eda7..d071e14 100644
--- a/2018/Cargo.toml
+++ b/2018/Cargo.toml
@@ -5,3 +5,5 @@ authors = ["tomsmeding <tom.smeding@gmail.com>"]
[dependencies]
argparse = "0.2.2"
+regex = "1"
+lazy_static = "1.2.0"
diff --git a/2018/input/4.txt b/2018/input/4.txt
new file mode 100644
index 0000000..cb7b58d
--- /dev/null
+++ b/2018/input/4.txt
@@ -0,0 +1,1086 @@
+[1518-09-02 00:18] wakes up
+[1518-03-08 00:37] falls asleep
+[1518-04-03 00:19] falls asleep
+[1518-09-12 00:02] falls asleep
+[1518-03-05 00:59] wakes up
+[1518-04-19 00:22] falls asleep
+[1518-10-18 23:51] Guard #349 begins shift
+[1518-09-14 23:59] Guard #1013 begins shift
+[1518-06-13 00:32] wakes up
+[1518-03-13 00:35] falls asleep
+[1518-06-04 00:45] wakes up
+[1518-04-13 00:01] falls asleep
+[1518-11-08 00:58] wakes up
+[1518-07-23 00:06] falls asleep
+[1518-04-12 00:40] falls asleep
+[1518-04-01 23:57] Guard #1013 begins shift
+[1518-05-07 00:13] falls asleep
+[1518-11-16 00:05] falls asleep
+[1518-09-29 00:41] falls asleep
+[1518-08-05 00:01] Guard #509 begins shift
+[1518-04-13 00:22] falls asleep
+[1518-10-27 00:01] Guard #1217 begins shift
+[1518-03-02 23:57] Guard #1249 begins shift
+[1518-06-03 00:36] wakes up
+[1518-10-17 00:01] Guard #1733 begins shift
+[1518-11-19 00:23] falls asleep
+[1518-04-30 00:06] falls asleep
+[1518-07-22 00:58] wakes up
+[1518-08-31 00:00] Guard #211 begins shift
+[1518-05-01 00:37] falls asleep
+[1518-08-01 23:59] Guard #509 begins shift
+[1518-07-14 00:49] falls asleep
+[1518-11-19 00:34] wakes up
+[1518-09-08 00:00] falls asleep
+[1518-11-18 00:02] Guard #3541 begins shift
+[1518-05-07 23:58] Guard #769 begins shift
+[1518-04-11 00:43] wakes up
+[1518-10-13 00:38] falls asleep
+[1518-04-26 00:19] falls asleep
+[1518-03-06 23:59] Guard #809 begins shift
+[1518-11-01 00:53] wakes up
+[1518-09-11 00:23] wakes up
+[1518-11-01 00:26] falls asleep
+[1518-10-07 00:12] falls asleep
+[1518-05-03 00:24] falls asleep
+[1518-11-23 00:49] wakes up
+[1518-09-25 23:56] Guard #2663 begins shift
+[1518-10-30 00:43] wakes up
+[1518-02-27 00:38] falls asleep
+[1518-08-23 00:02] Guard #769 begins shift
+[1518-03-14 00:03] Guard #2039 begins shift
+[1518-06-13 00:14] falls asleep
+[1518-06-18 00:15] falls asleep
+[1518-05-01 00:02] falls asleep
+[1518-04-04 00:39] falls asleep
+[1518-05-28 00:30] falls asleep
+[1518-04-04 23:58] Guard #1321 begins shift
+[1518-11-05 00:15] falls asleep
+[1518-06-20 00:55] wakes up
+[1518-10-21 00:52] wakes up
+[1518-08-26 00:00] Guard #1987 begins shift
+[1518-03-04 00:48] falls asleep
+[1518-03-29 00:59] wakes up
+[1518-06-05 00:00] falls asleep
+[1518-10-15 00:25] wakes up
+[1518-11-11 00:48] falls asleep
+[1518-09-24 23:53] Guard #509 begins shift
+[1518-04-04 00:35] wakes up
+[1518-05-15 00:42] falls asleep
+[1518-05-26 00:24] wakes up
+[1518-06-05 00:44] wakes up
+[1518-10-27 00:57] wakes up
+[1518-03-15 00:38] falls asleep
+[1518-03-08 00:56] falls asleep
+[1518-09-19 00:00] Guard #1217 begins shift
+[1518-10-28 00:36] falls asleep
+[1518-11-07 23:56] Guard #877 begins shift
+[1518-07-29 23:58] Guard #1867 begins shift
+[1518-04-18 00:20] wakes up
+[1518-09-19 23:56] Guard #191 begins shift
+[1518-04-17 00:49] wakes up
+[1518-04-16 00:00] Guard #1733 begins shift
+[1518-11-03 00:46] falls asleep
+[1518-10-20 00:33] falls asleep
+[1518-10-21 00:00] Guard #349 begins shift
+[1518-09-26 00:33] falls asleep
+[1518-08-31 00:42] falls asleep
+[1518-04-20 23:56] Guard #1733 begins shift
+[1518-08-22 00:57] wakes up
+[1518-07-14 23:58] Guard #1249 begins shift
+[1518-04-11 00:37] falls asleep
+[1518-10-02 00:30] wakes up
+[1518-06-08 00:30] wakes up
+[1518-10-23 00:28] wakes up
+[1518-10-02 00:42] falls asleep
+[1518-08-31 00:46] wakes up
+[1518-10-06 00:59] wakes up
+[1518-08-29 23:58] Guard #1217 begins shift
+[1518-06-18 00:56] falls asleep
+[1518-06-24 23:58] Guard #2347 begins shift
+[1518-11-02 00:37] falls asleep
+[1518-03-03 00:41] falls asleep
+[1518-09-05 23:56] Guard #509 begins shift
+[1518-10-31 00:41] falls asleep
+[1518-06-25 00:51] wakes up
+[1518-10-11 23:50] Guard #877 begins shift
+[1518-03-24 00:21] falls asleep
+[1518-08-20 00:48] wakes up
+[1518-08-13 00:59] wakes up
+[1518-10-15 00:56] falls asleep
+[1518-04-27 00:27] wakes up
+[1518-04-08 00:25] wakes up
+[1518-06-05 00:13] falls asleep
+[1518-08-06 00:29] falls asleep
+[1518-08-17 00:52] wakes up
+[1518-07-06 00:12] wakes up
+[1518-08-19 00:57] wakes up
+[1518-05-01 00:17] wakes up
+[1518-06-27 00:16] falls asleep
+[1518-04-17 00:47] falls asleep
+[1518-11-23 00:56] falls asleep
+[1518-05-24 00:43] falls asleep
+[1518-05-12 00:42] falls asleep
+[1518-09-03 00:31] wakes up
+[1518-09-09 00:39] falls asleep
+[1518-10-03 00:51] falls asleep
+[1518-10-01 00:58] wakes up
+[1518-10-29 00:19] wakes up
+[1518-07-05 00:41] falls asleep
+[1518-04-03 00:48] falls asleep
+[1518-02-28 00:28] falls asleep
+[1518-06-15 23:59] Guard #1013 begins shift
+[1518-06-14 00:33] falls asleep
+[1518-10-05 23:56] Guard #1987 begins shift
+[1518-08-10 00:54] falls asleep
+[1518-10-31 00:42] wakes up
+[1518-06-26 00:17] wakes up
+[1518-08-02 23:57] Guard #1217 begins shift
+[1518-08-16 00:30] falls asleep
+[1518-07-29 00:10] falls asleep
+[1518-03-14 23:59] Guard #661 begins shift
+[1518-05-20 00:41] falls asleep
+[1518-09-25 00:06] wakes up
+[1518-07-01 00:04] Guard #509 begins shift
+[1518-05-03 00:25] wakes up
+[1518-06-27 00:47] falls asleep
+[1518-06-02 00:10] falls asleep
+[1518-11-07 00:00] Guard #1013 begins shift
+[1518-06-05 00:10] wakes up
+[1518-08-09 00:04] Guard #661 begins shift
+[1518-03-25 00:39] falls asleep
+[1518-09-19 00:28] wakes up
+[1518-08-26 00:52] wakes up
+[1518-11-12 00:00] falls asleep
+[1518-10-15 00:53] wakes up
+[1518-06-12 00:31] wakes up
+[1518-10-08 00:48] wakes up
+[1518-09-27 00:49] falls asleep
+[1518-03-10 00:56] wakes up
+[1518-02-26 00:05] falls asleep
+[1518-11-05 00:30] wakes up
+[1518-04-01 00:04] falls asleep
+[1518-05-11 00:46] wakes up
+[1518-10-03 00:53] wakes up
+[1518-07-18 00:51] falls asleep
+[1518-02-27 00:04] Guard #1453 begins shift
+[1518-09-24 00:03] Guard #1987 begins shift
+[1518-05-31 00:09] falls asleep
+[1518-07-30 00:42] falls asleep
+[1518-05-31 00:33] wakes up
+[1518-06-09 00:55] wakes up
+[1518-07-06 23:51] Guard #2663 begins shift
+[1518-09-01 23:52] Guard #1217 begins shift
+[1518-09-10 00:57] wakes up
+[1518-08-26 00:21] falls asleep
+[1518-03-07 00:49] wakes up
+[1518-04-08 00:36] falls asleep
+[1518-10-25 00:01] falls asleep
+[1518-08-25 00:37] wakes up
+[1518-07-29 00:59] wakes up
+[1518-04-03 00:20] wakes up
+[1518-09-26 00:56] falls asleep
+[1518-08-02 00:57] wakes up
+[1518-09-26 00:49] wakes up
+[1518-09-23 00:38] falls asleep
+[1518-09-26 00:17] falls asleep
+[1518-09-27 00:46] wakes up
+[1518-03-05 00:14] falls asleep
+[1518-04-03 23:50] Guard #877 begins shift
+[1518-02-26 00:35] falls asleep
+[1518-08-12 00:24] falls asleep
+[1518-08-27 00:28] wakes up
+[1518-09-29 00:49] wakes up
+[1518-11-02 00:42] wakes up
+[1518-03-29 00:17] falls asleep
+[1518-09-23 00:30] wakes up
+[1518-07-27 00:29] wakes up
+[1518-09-20 00:26] falls asleep
+[1518-07-18 00:09] falls asleep
+[1518-05-29 23:52] Guard #2039 begins shift
+[1518-05-08 00:53] wakes up
+[1518-08-03 00:35] falls asleep
+[1518-03-12 00:49] falls asleep
+[1518-04-18 00:39] falls asleep
+[1518-11-09 00:12] falls asleep
+[1518-10-11 00:03] Guard #233 begins shift
+[1518-11-07 00:36] falls asleep
+[1518-09-07 00:52] wakes up
+[1518-04-16 00:41] wakes up
+[1518-03-01 00:58] wakes up
+[1518-07-03 00:40] wakes up
+[1518-05-18 00:56] wakes up
+[1518-11-19 00:54] wakes up
+[1518-10-30 00:38] falls asleep
+[1518-06-04 00:30] wakes up
+[1518-10-31 00:34] wakes up
+[1518-08-07 00:59] wakes up
+[1518-08-21 00:55] wakes up
+[1518-08-05 00:11] falls asleep
+[1518-03-15 00:49] wakes up
+[1518-04-22 00:03] Guard #769 begins shift
+[1518-10-28 00:58] wakes up
+[1518-04-18 00:56] wakes up
+[1518-11-13 00:10] wakes up
+[1518-11-09 00:43] wakes up
+[1518-07-06 00:03] falls asleep
+[1518-10-31 00:31] falls asleep
+[1518-08-01 00:02] Guard #1451 begins shift
+[1518-05-26 00:38] falls asleep
+[1518-08-10 00:47] falls asleep
+[1518-07-11 00:55] wakes up
+[1518-04-11 23:58] Guard #809 begins shift
+[1518-05-08 23:58] Guard #1217 begins shift
+[1518-09-27 23:59] Guard #3541 begins shift
+[1518-10-17 00:39] wakes up
+[1518-11-09 23:57] Guard #1733 begins shift
+[1518-07-26 00:04] falls asleep
+[1518-03-05 00:43] wakes up
+[1518-10-25 00:48] wakes up
+[1518-09-06 00:37] wakes up
+[1518-04-17 00:31] wakes up
+[1518-03-26 23:50] Guard #877 begins shift
+[1518-09-05 00:41] wakes up
+[1518-10-25 00:37] falls asleep
+[1518-03-21 00:10] falls asleep
+[1518-06-27 00:37] wakes up
+[1518-06-03 00:09] falls asleep
+[1518-11-18 00:21] falls asleep
+[1518-11-02 00:48] wakes up
+[1518-04-02 23:57] Guard #769 begins shift
+[1518-04-22 23:56] Guard #1453 begins shift
+[1518-10-09 23:56] Guard #769 begins shift
+[1518-06-01 23:59] Guard #191 begins shift
+[1518-06-27 00:50] wakes up
+[1518-04-29 00:43] wakes up
+[1518-11-02 23:58] Guard #1013 begins shift
+[1518-09-01 00:01] Guard #2039 begins shift
+[1518-02-25 00:27] falls asleep
+[1518-07-20 00:09] falls asleep
+[1518-08-07 00:31] falls asleep
+[1518-06-13 00:51] wakes up
+[1518-07-29 00:01] Guard #1733 begins shift
+[1518-07-15 00:58] wakes up
+[1518-07-11 00:04] Guard #809 begins shift
+[1518-03-06 00:47] wakes up
+[1518-05-07 00:30] wakes up
+[1518-09-10 00:56] falls asleep
+[1518-10-10 00:51] wakes up
+[1518-03-21 00:53] wakes up
+[1518-09-23 00:19] falls asleep
+[1518-11-11 00:04] Guard #769 begins shift
+[1518-10-04 00:04] Guard #2039 begins shift
+[1518-09-01 00:47] falls asleep
+[1518-10-05 00:27] falls asleep
+[1518-03-13 00:37] wakes up
+[1518-03-30 00:59] wakes up
+[1518-06-15 00:31] falls asleep
+[1518-06-04 00:38] falls asleep
+[1518-11-05 00:49] wakes up
+[1518-08-02 00:27] falls asleep
+[1518-11-08 00:11] falls asleep
+[1518-11-15 00:58] wakes up
+[1518-04-01 00:52] wakes up
+[1518-10-19 00:50] falls asleep
+[1518-03-28 00:57] wakes up
+[1518-09-10 00:19] falls asleep
+[1518-11-04 00:58] wakes up
+[1518-11-09 00:00] Guard #349 begins shift
+[1518-06-23 00:27] falls asleep
+[1518-09-20 00:42] wakes up
+[1518-05-02 00:13] falls asleep
+[1518-10-28 23:59] Guard #3541 begins shift
+[1518-05-12 00:04] Guard #1013 begins shift
+[1518-06-20 00:21] wakes up
+[1518-04-30 00:00] Guard #1987 begins shift
+[1518-03-26 00:18] falls asleep
+[1518-09-21 00:57] wakes up
+[1518-07-18 00:56] wakes up
+[1518-06-11 23:51] Guard #1987 begins shift
+[1518-08-28 00:10] falls asleep
+[1518-06-11 00:30] wakes up
+[1518-03-03 00:57] wakes up
+[1518-06-28 23:49] Guard #3541 begins shift
+[1518-04-10 00:45] wakes up
+[1518-04-22 00:21] falls asleep
+[1518-07-27 23:57] Guard #211 begins shift
+[1518-05-13 23:56] Guard #1733 begins shift
+[1518-11-08 00:44] falls asleep
+[1518-09-06 00:57] wakes up
+[1518-10-27 00:36] falls asleep
+[1518-11-06 00:32] wakes up
+[1518-07-24 23:57] Guard #661 begins shift
+[1518-08-09 00:23] falls asleep
+[1518-10-29 00:11] falls asleep
+[1518-08-17 00:06] falls asleep
+[1518-05-06 00:33] falls asleep
+[1518-05-11 00:30] falls asleep
+[1518-09-28 00:37] wakes up
+[1518-04-24 00:27] wakes up
+[1518-08-20 23:59] Guard #233 begins shift
+[1518-08-23 00:38] falls asleep
+[1518-09-17 00:51] wakes up
+[1518-05-12 00:51] wakes up
+[1518-05-25 00:51] falls asleep
+[1518-08-06 00:03] Guard #877 begins shift
+[1518-05-19 00:04] Guard #349 begins shift
+[1518-09-29 00:02] Guard #1867 begins shift
+[1518-07-19 00:51] wakes up
+[1518-10-27 00:37] wakes up
+[1518-08-10 00:49] wakes up
+[1518-03-16 00:16] falls asleep
+[1518-08-10 00:41] wakes up
+[1518-10-26 00:31] wakes up
+[1518-11-22 00:55] wakes up
+[1518-05-19 00:41] wakes up
+[1518-04-15 00:04] falls asleep
+[1518-03-11 00:53] wakes up
+[1518-09-02 23:56] Guard #1867 begins shift
+[1518-10-12 00:42] wakes up
+[1518-03-20 00:53] falls asleep
+[1518-04-24 00:09] falls asleep
+[1518-03-28 23:58] Guard #2039 begins shift
+[1518-06-28 00:58] wakes up
+[1518-07-25 23:52] Guard #509 begins shift
+[1518-06-22 00:41] wakes up
+[1518-06-11 00:34] falls asleep
+[1518-10-03 00:48] wakes up
+[1518-06-10 00:04] Guard #2039 begins shift
+[1518-06-12 00:48] falls asleep
+[1518-06-14 00:44] wakes up
+[1518-06-12 00:59] wakes up
+[1518-09-28 00:10] falls asleep
+[1518-03-20 00:59] wakes up
+[1518-11-20 23:56] Guard #1321 begins shift
+[1518-04-30 00:43] wakes up
+[1518-06-24 00:00] Guard #2663 begins shift
+[1518-10-07 00:48] falls asleep
+[1518-07-21 23:57] Guard #211 begins shift
+[1518-11-04 00:56] falls asleep
+[1518-05-13 00:59] wakes up
+[1518-04-14 23:47] Guard #1249 begins shift
+[1518-10-23 00:56] falls asleep
+[1518-09-09 00:00] Guard #1867 begins shift
+[1518-11-23 00:57] wakes up
+[1518-03-06 00:13] falls asleep
+[1518-03-31 00:56] wakes up
+[1518-11-13 00:44] falls asleep
+[1518-03-03 23:47] Guard #2039 begins shift
+[1518-06-02 00:51] wakes up
+[1518-05-13 00:42] falls asleep
+[1518-08-28 23:57] Guard #1249 begins shift
+[1518-06-30 00:22] falls asleep
+[1518-08-13 00:28] falls asleep
+[1518-03-17 00:47] wakes up
+[1518-09-12 23:59] Guard #1453 begins shift
+[1518-03-29 00:53] falls asleep
+[1518-07-24 00:27] wakes up
+[1518-09-15 00:34] falls asleep
+[1518-05-14 00:47] wakes up
+[1518-10-01 00:28] wakes up
+[1518-09-11 00:44] falls asleep
+[1518-07-27 00:00] Guard #2347 begins shift
+[1518-08-12 00:03] Guard #661 begins shift
+[1518-10-28 00:57] falls asleep
+[1518-08-27 00:08] falls asleep
+[1518-10-29 00:32] wakes up
+[1518-05-25 00:52] wakes up
+[1518-03-31 23:47] Guard #769 begins shift
+[1518-04-07 00:59] wakes up
+[1518-04-17 00:56] falls asleep
+[1518-09-18 00:28] falls asleep
+[1518-11-23 00:03] Guard #2663 begins shift
+[1518-03-01 00:00] Guard #769 begins shift
+[1518-04-14 00:43] wakes up
+[1518-03-27 00:46] wakes up
+[1518-09-24 00:56] wakes up
+[1518-09-02 00:59] wakes up
+[1518-03-23 23:56] Guard #1733 begins shift
+[1518-11-16 00:55] wakes up
+[1518-03-08 00:59] wakes up
+[1518-09-25 00:38] wakes up
+[1518-09-18 00:01] Guard #1249 begins shift
+[1518-08-15 00:44] wakes up
+[1518-07-03 00:00] Guard #1733 begins shift
+[1518-09-04 00:49] wakes up
+[1518-06-10 00:47] wakes up
+[1518-03-16 00:52] wakes up
+[1518-08-12 00:48] wakes up
+[1518-03-12 00:00] Guard #1249 begins shift
+[1518-09-16 00:23] falls asleep
+[1518-09-14 00:57] wakes up
+[1518-10-31 00:01] Guard #809 begins shift
+[1518-04-25 00:51] wakes up
+[1518-10-28 00:41] wakes up
+[1518-07-09 23:56] Guard #809 begins shift
+[1518-03-12 00:56] wakes up
+[1518-03-23 00:53] falls asleep
+[1518-10-31 00:47] falls asleep
+[1518-04-22 00:57] wakes up
+[1518-05-16 00:44] wakes up
+[1518-04-22 00:54] falls asleep
+[1518-08-12 00:18] wakes up
+[1518-07-28 00:42] wakes up
+[1518-03-18 00:29] falls asleep
+[1518-11-15 00:30] falls asleep
+[1518-10-30 00:52] falls asleep
+[1518-11-16 23:50] Guard #509 begins shift
+[1518-06-29 23:59] Guard #661 begins shift
+[1518-10-31 00:55] wakes up
+[1518-11-02 00:46] falls asleep
+[1518-08-15 00:40] wakes up
+[1518-08-06 00:37] wakes up
+[1518-04-12 23:48] Guard #877 begins shift
+[1518-10-16 00:02] Guard #809 begins shift
+[1518-10-11 00:35] falls asleep
+[1518-06-16 00:56] wakes up
+[1518-07-30 00:11] wakes up
+[1518-08-16 00:57] wakes up
+[1518-10-12 23:56] Guard #1453 begins shift
+[1518-03-22 00:05] falls asleep
+[1518-07-25 00:59] wakes up
+[1518-09-26 00:58] wakes up
+[1518-04-26 23:56] Guard #233 begins shift
+[1518-07-22 00:50] wakes up
+[1518-07-14 00:37] wakes up
+[1518-05-03 00:39] falls asleep
+[1518-04-10 00:18] falls asleep
+[1518-11-14 23:57] Guard #349 begins shift
+[1518-02-28 00:20] falls asleep
+[1518-06-11 00:55] wakes up
+[1518-11-23 00:28] falls asleep
+[1518-10-25 23:53] Guard #1867 begins shift
+[1518-07-20 00:10] wakes up
+[1518-10-21 00:27] falls asleep
+[1518-07-11 00:43] falls asleep
+[1518-06-24 00:11] falls asleep
+[1518-11-03 00:48] wakes up
+[1518-10-07 00:50] wakes up
+[1518-06-06 00:58] wakes up
+[1518-10-24 00:36] falls asleep
+[1518-07-30 00:53] wakes up
+[1518-05-10 00:03] Guard #1321 begins shift
+[1518-08-14 00:25] falls asleep
+[1518-03-13 00:02] Guard #3541 begins shift
+[1518-03-13 00:26] wakes up
+[1518-04-18 00:14] falls asleep
+[1518-04-29 00:01] Guard #1733 begins shift
+[1518-06-18 23:57] Guard #1733 begins shift
+[1518-05-24 00:52] wakes up
+[1518-03-30 00:49] falls asleep
+[1518-04-18 00:48] falls asleep
+[1518-03-27 00:57] wakes up
+[1518-06-19 00:55] falls asleep
+[1518-05-21 23:59] Guard #1217 begins shift
+[1518-06-27 00:00] Guard #1217 begins shift
+[1518-06-05 00:38] falls asleep
+[1518-06-20 00:37] falls asleep
+[1518-11-05 00:36] falls asleep
+[1518-06-04 00:01] Guard #1987 begins shift
+[1518-08-29 00:55] wakes up
+[1518-07-27 00:23] falls asleep
+[1518-09-02 00:05] falls asleep
+[1518-05-26 00:57] falls asleep
+[1518-11-03 00:36] wakes up
+[1518-10-24 23:48] Guard #809 begins shift
+[1518-07-12 00:53] falls asleep
+[1518-08-28 00:02] Guard #1453 begins shift
+[1518-08-16 00:55] falls asleep
+[1518-03-05 00:01] Guard #877 begins shift
+[1518-07-21 00:03] Guard #2039 begins shift
+[1518-11-13 00:49] wakes up
+[1518-06-09 00:00] Guard #1249 begins shift
+[1518-08-23 00:55] wakes up
+[1518-05-22 00:54] wakes up
+[1518-09-16 23:59] Guard #349 begins shift
+[1518-03-03 00:55] falls asleep
+[1518-07-25 00:49] falls asleep
+[1518-08-03 00:39] wakes up
+[1518-03-30 00:46] wakes up
+[1518-05-15 00:39] wakes up
+[1518-08-10 23:46] Guard #809 begins shift
+[1518-06-19 00:35] falls asleep
+[1518-04-03 00:58] wakes up
+[1518-07-02 00:11] falls asleep
+[1518-07-19 23:59] Guard #2347 begins shift
+[1518-03-01 00:13] falls asleep
+[1518-11-17 00:29] wakes up
+[1518-03-31 00:46] falls asleep
+[1518-11-20 00:01] falls asleep
+[1518-05-03 00:47] wakes up
+[1518-03-04 00:01] falls asleep
+[1518-08-18 00:50] wakes up
+[1518-08-06 00:56] wakes up
+[1518-10-14 00:38] wakes up
+[1518-04-14 00:03] Guard #349 begins shift
+[1518-04-09 00:28] wakes up
+[1518-08-03 00:07] falls asleep
+[1518-07-30 23:59] Guard #2347 begins shift
+[1518-10-23 23:58] Guard #661 begins shift
+[1518-08-16 00:02] Guard #2347 begins shift
+[1518-06-24 00:36] wakes up
+[1518-10-10 00:17] falls asleep
+[1518-04-27 00:44] wakes up
+[1518-02-26 00:29] wakes up
+[1518-09-29 00:58] wakes up
+[1518-04-06 00:12] falls asleep
+[1518-07-05 00:02] Guard #1013 begins shift
+[1518-03-15 23:59] Guard #3541 begins shift
+[1518-07-02 00:00] Guard #1867 begins shift
+[1518-08-15 00:18] falls asleep
+[1518-05-04 00:32] falls asleep
+[1518-04-23 00:42] wakes up
+[1518-06-14 00:30] wakes up
+[1518-03-30 23:54] Guard #2039 begins shift
+[1518-07-16 23:57] Guard #1321 begins shift
+[1518-08-15 00:01] Guard #211 begins shift
+[1518-11-06 00:51] falls asleep
+[1518-08-03 00:46] falls asleep
+[1518-06-15 00:00] Guard #1013 begins shift
+[1518-03-27 00:50] falls asleep
+[1518-05-14 00:40] falls asleep
+[1518-05-11 00:54] falls asleep
+[1518-10-13 23:59] Guard #877 begins shift
+[1518-07-07 00:12] wakes up
+[1518-03-21 00:56] falls asleep
+[1518-07-26 00:58] wakes up
+[1518-04-30 23:53] Guard #661 begins shift
+[1518-07-16 00:03] Guard #769 begins shift
+[1518-09-07 00:00] Guard #2347 begins shift
+[1518-05-14 23:57] Guard #509 begins shift
+[1518-11-09 00:50] falls asleep
+[1518-10-09 00:34] falls asleep
+[1518-03-25 00:58] wakes up
+[1518-03-22 00:56] wakes up
+[1518-04-02 00:37] falls asleep
+[1518-11-19 00:43] falls asleep
+[1518-10-16 00:46] falls asleep
+[1518-08-25 00:43] falls asleep
+[1518-09-07 23:48] Guard #809 begins shift
+[1518-08-26 00:55] falls asleep
+[1518-07-29 00:36] falls asleep
+[1518-05-25 00:05] falls asleep
+[1518-03-19 00:42] falls asleep
+[1518-08-28 00:56] wakes up
+[1518-05-01 23:57] Guard #211 begins shift
+[1518-09-08 00:53] wakes up
+[1518-10-18 00:00] Guard #2039 begins shift
+[1518-10-10 00:48] falls asleep
+[1518-11-18 23:56] Guard #211 begins shift
+[1518-07-05 00:57] wakes up
+[1518-08-30 00:19] falls asleep
+[1518-07-31 00:27] falls asleep
+[1518-04-12 00:09] falls asleep
+[1518-08-22 00:40] falls asleep
+[1518-04-15 00:53] falls asleep
+[1518-10-06 00:42] falls asleep
+[1518-06-09 00:53] falls asleep
+[1518-09-05 00:10] falls asleep
+[1518-05-06 00:04] Guard #211 begins shift
+[1518-05-30 00:05] falls asleep
+[1518-11-17 00:00] falls asleep
+[1518-11-12 00:57] wakes up
+[1518-05-12 23:59] Guard #2347 begins shift
+[1518-10-02 00:02] Guard #1987 begins shift
+[1518-05-25 23:47] Guard #2663 begins shift
+[1518-11-19 23:53] Guard #1987 begins shift
+[1518-04-12 00:47] wakes up
+[1518-06-22 00:47] falls asleep
+[1518-08-06 00:07] falls asleep
+[1518-09-22 00:55] wakes up
+[1518-11-05 00:04] Guard #1733 begins shift
+[1518-09-30 00:28] falls asleep
+[1518-03-24 00:35] wakes up
+[1518-05-20 00:43] wakes up
+[1518-07-18 00:00] Guard #2039 begins shift
+[1518-03-01 23:50] Guard #1453 begins shift
+[1518-04-20 00:00] Guard #211 begins shift
+[1518-03-10 00:08] falls asleep
+[1518-06-19 00:56] wakes up
+[1518-05-11 00:59] wakes up
+[1518-04-26 00:59] wakes up
+[1518-08-25 00:19] falls asleep
+[1518-02-28 00:25] wakes up
+[1518-07-08 23:59] Guard #211 begins shift
+[1518-09-13 00:42] wakes up
+[1518-07-12 00:55] wakes up
+[1518-08-13 00:54] falls asleep
+[1518-09-15 00:14] falls asleep
+[1518-03-17 00:50] falls asleep
+[1518-03-17 00:51] wakes up
+[1518-04-28 00:14] falls asleep
+[1518-10-06 00:55] falls asleep
+[1518-05-07 00:03] Guard #1987 begins shift
+[1518-10-22 00:34] falls asleep
+[1518-02-26 00:36] wakes up
+[1518-03-30 00:02] Guard #2039 begins shift
+[1518-04-21 00:20] falls asleep
+[1518-06-04 00:08] falls asleep
+[1518-05-09 00:41] wakes up
+[1518-05-17 00:47] wakes up
+[1518-09-21 00:11] falls asleep
+[1518-10-10 00:35] wakes up
+[1518-07-13 00:16] falls asleep
+[1518-05-05 00:52] falls asleep
+[1518-03-14 00:33] falls asleep
+[1518-04-27 00:48] falls asleep
+[1518-08-08 00:36] falls asleep
+[1518-04-10 00:00] Guard #1733 begins shift
+[1518-05-15 00:50] wakes up
+[1518-07-30 00:06] falls asleep
+[1518-09-07 00:13] falls asleep
+[1518-04-13 00:50] wakes up
+[1518-10-26 00:04] falls asleep
+[1518-05-04 00:52] wakes up
+[1518-03-31 00:35] wakes up
+[1518-04-25 00:00] Guard #1013 begins shift
+[1518-09-16 00:56] wakes up
+[1518-09-27 00:01] Guard #661 begins shift
+[1518-04-17 00:29] falls asleep
+[1518-05-05 00:37] wakes up
+[1518-04-11 00:58] wakes up
+[1518-09-05 00:00] Guard #509 begins shift
+[1518-08-04 00:57] wakes up
+[1518-10-14 00:10] falls asleep
+[1518-07-02 00:58] wakes up
+[1518-05-03 00:58] wakes up
+[1518-08-15 00:56] wakes up
+[1518-10-05 00:45] wakes up
+[1518-04-14 00:28] falls asleep
+[1518-03-30 00:41] falls asleep
+[1518-06-09 00:31] falls asleep
+[1518-08-07 23:58] Guard #211 begins shift
+[1518-09-13 00:25] falls asleep
+[1518-11-13 00:00] falls asleep
+[1518-10-17 00:42] falls asleep
+[1518-05-08 00:41] falls asleep
+[1518-05-28 00:38] wakes up
+[1518-03-08 00:38] wakes up
+[1518-09-02 00:35] falls asleep
+[1518-10-22 00:49] wakes up
+[1518-04-06 23:56] Guard #1217 begins shift
+[1518-06-30 00:51] wakes up
+[1518-09-11 00:22] falls asleep
+[1518-04-02 00:52] wakes up
+[1518-08-27 00:55] wakes up
+[1518-05-06 00:48] wakes up
+[1518-09-14 00:44] wakes up
+[1518-05-11 00:36] wakes up
+[1518-02-25 23:53] Guard #211 begins shift
+[1518-06-06 00:51] falls asleep
+[1518-06-12 00:04] falls asleep
+[1518-09-14 00:52] falls asleep
+[1518-08-22 00:26] wakes up
+[1518-10-02 00:57] wakes up
+[1518-11-01 23:59] Guard #1733 begins shift
+[1518-05-16 00:04] Guard #1733 begins shift
+[1518-03-19 00:00] Guard #769 begins shift
+[1518-10-15 00:42] falls asleep
+[1518-09-03 23:56] Guard #191 begins shift
+[1518-09-10 23:56] Guard #211 begins shift
+[1518-05-20 00:47] falls asleep
+[1518-06-18 00:57] wakes up
+[1518-04-23 00:23] wakes up
+[1518-05-29 00:04] Guard #2347 begins shift
+[1518-05-16 00:25] falls asleep
+[1518-06-20 23:50] Guard #1987 begins shift
+[1518-11-10 00:39] wakes up
+[1518-06-06 00:45] wakes up
+[1518-08-03 00:28] falls asleep
+[1518-08-26 00:43] wakes up
+[1518-08-19 00:04] Guard #2663 begins shift
+[1518-08-22 00:14] falls asleep
+[1518-11-22 00:46] falls asleep
+[1518-07-18 23:58] Guard #809 begins shift
+[1518-04-04 00:55] wakes up
+[1518-07-21 00:16] falls asleep
+[1518-09-03 00:13] falls asleep
+[1518-09-04 00:28] falls asleep
+[1518-06-13 23:56] Guard #1013 begins shift
+[1518-06-02 23:59] Guard #1987 begins shift
+[1518-11-03 23:57] Guard #1453 begins shift
+[1518-06-06 00:37] falls asleep
+[1518-02-25 00:58] wakes up
+[1518-06-28 00:04] Guard #1249 begins shift
+[1518-09-14 00:01] falls asleep
+[1518-05-20 00:55] wakes up
+[1518-05-19 23:56] Guard #191 begins shift
+[1518-07-03 23:58] Guard #661 begins shift
+[1518-09-11 23:47] Guard #1733 begins shift
+[1518-05-05 00:13] falls asleep
+[1518-06-26 00:04] Guard #1013 begins shift
+[1518-04-24 00:37] wakes up
+[1518-04-23 00:33] falls asleep
+[1518-04-23 23:59] Guard #1217 begins shift
+[1518-09-19 00:08] falls asleep
+[1518-03-19 00:55] wakes up
+[1518-04-21 00:50] wakes up
+[1518-04-13 00:06] wakes up
+[1518-11-02 00:59] wakes up
+[1518-04-25 23:58] Guard #233 begins shift
+[1518-06-07 00:24] falls asleep
+[1518-08-10 00:00] Guard #1217 begins shift
+[1518-07-04 00:54] wakes up
+[1518-07-11 23:56] Guard #191 begins shift
+[1518-11-13 23:56] Guard #349 begins shift
+[1518-09-01 00:51] wakes up
+[1518-07-14 00:00] Guard #349 begins shift
+[1518-05-09 00:47] falls asleep
+[1518-04-17 00:04] Guard #509 begins shift
+[1518-08-03 00:30] wakes up
+[1518-05-16 23:58] Guard #769 begins shift
+[1518-11-12 23:50] Guard #349 begins shift
+[1518-07-12 00:12] falls asleep
+[1518-10-13 00:15] wakes up
+[1518-06-07 23:56] Guard #877 begins shift
+[1518-10-19 00:03] falls asleep
+[1518-10-13 00:09] falls asleep
+[1518-07-16 00:15] falls asleep
+[1518-09-06 00:42] falls asleep
+[1518-07-18 00:37] wakes up
+[1518-10-11 00:58] wakes up
+[1518-06-06 00:03] Guard #233 begins shift
+[1518-11-06 00:55] wakes up
+[1518-07-09 00:15] falls asleep
+[1518-10-01 00:22] falls asleep
+[1518-03-25 00:29] wakes up
+[1518-10-29 23:58] Guard #1733 begins shift
+[1518-03-19 23:57] Guard #1013 begins shift
+[1518-11-08 00:26] wakes up
+[1518-10-08 00:44] falls asleep
+[1518-05-15 00:21] falls asleep
+[1518-08-14 00:49] wakes up
+[1518-07-31 00:57] wakes up
+[1518-03-02 00:01] falls asleep
+[1518-06-22 00:59] wakes up
+[1518-10-18 00:20] falls asleep
+[1518-05-03 00:50] falls asleep
+[1518-09-30 23:56] Guard #1217 begins shift
+[1518-07-13 00:55] wakes up
+[1518-05-19 00:29] falls asleep
+[1518-06-16 23:59] Guard #809 begins shift
+[1518-06-12 00:49] wakes up
+[1518-03-27 00:04] falls asleep
+[1518-04-16 00:32] falls asleep
+[1518-09-30 00:49] wakes up
+[1518-04-18 00:43] wakes up
+[1518-11-15 00:25] wakes up
+[1518-05-10 23:56] Guard #1987 begins shift
+[1518-04-22 00:47] wakes up
+[1518-11-21 23:58] Guard #3541 begins shift
+[1518-09-22 00:03] Guard #2039 begins shift
+[1518-06-14 00:15] falls asleep
+[1518-03-04 00:55] wakes up
+[1518-07-27 00:51] wakes up
+[1518-06-16 00:30] falls asleep
+[1518-10-04 00:50] wakes up
+[1518-08-19 00:53] falls asleep
+[1518-09-13 23:48] Guard #2347 begins shift
+[1518-03-12 00:34] falls asleep
+[1518-05-07 00:57] wakes up
+[1518-06-18 00:47] wakes up
+[1518-05-14 00:14] wakes up
+[1518-05-18 00:46] falls asleep
+[1518-06-04 23:48] Guard #1733 begins shift
+[1518-07-03 00:07] falls asleep
+[1518-07-09 00:53] wakes up
+[1518-08-06 00:46] falls asleep
+[1518-09-29 00:54] falls asleep
+[1518-10-25 00:10] wakes up
+[1518-08-03 00:54] wakes up
+[1518-06-15 00:56] wakes up
+[1518-09-09 23:57] Guard #1249 begins shift
+[1518-06-10 00:10] falls asleep
+[1518-10-27 00:52] falls asleep
+[1518-05-25 00:46] wakes up
+[1518-04-27 00:39] falls asleep
+[1518-04-29 00:08] falls asleep
+[1518-05-26 00:01] falls asleep
+[1518-03-01 00:50] wakes up
+[1518-09-23 00:57] wakes up
+[1518-10-19 00:47] wakes up
+[1518-07-01 00:36] falls asleep
+[1518-07-19 00:39] falls asleep
+[1518-05-29 00:59] wakes up
+[1518-06-21 23:56] Guard #2039 begins shift
+[1518-09-15 00:29] wakes up
+[1518-08-09 00:43] wakes up
+[1518-10-23 00:45] falls asleep
+[1518-05-18 00:00] Guard #2347 begins shift
+[1518-03-20 23:56] Guard #349 begins shift
+[1518-06-22 00:40] falls asleep
+[1518-10-15 00:18] falls asleep
+[1518-10-27 00:07] falls asleep
+[1518-05-01 00:48] wakes up
+[1518-06-11 00:18] falls asleep
+[1518-08-06 00:19] wakes up
+[1518-02-24 23:58] Guard #2347 begins shift
+[1518-09-15 00:56] wakes up
+[1518-09-16 00:02] Guard #809 begins shift
+[1518-09-25 00:15] falls asleep
+[1518-04-25 00:46] falls asleep
+[1518-11-01 00:00] Guard #3541 begins shift
+[1518-10-21 23:58] Guard #1733 begins shift
+[1518-05-19 00:50] falls asleep
+[1518-06-08 00:53] falls asleep
+[1518-10-03 00:23] falls asleep
+[1518-10-03 00:00] Guard #2347 begins shift
+[1518-03-14 00:55] wakes up
+[1518-05-23 00:27] falls asleep
+[1518-08-18 00:11] falls asleep
+[1518-11-18 00:48] wakes up
+[1518-04-04 00:01] falls asleep
+[1518-07-12 00:36] wakes up
+[1518-03-21 23:48] Guard #661 begins shift
+[1518-08-08 00:53] wakes up
+[1518-11-09 00:55] wakes up
+[1518-09-22 00:23] falls asleep
+[1518-04-13 00:35] falls asleep
+[1518-08-31 00:29] wakes up
+[1518-10-20 00:00] Guard #191 begins shift
+[1518-05-19 00:53] wakes up
+[1518-11-18 00:09] falls asleep
+[1518-03-02 00:39] wakes up
+[1518-04-08 00:22] falls asleep
+[1518-08-10 00:56] wakes up
+[1518-11-06 00:01] Guard #2347 begins shift
+[1518-05-24 00:02] Guard #1249 begins shift
+[1518-05-23 00:00] Guard #1013 begins shift
+[1518-03-23 00:02] Guard #2039 begins shift
+[1518-05-26 23:47] Guard #211 begins shift
+[1518-05-05 00:03] Guard #2347 begins shift
+[1518-08-25 00:00] Guard #211 begins shift
+[1518-07-16 00:18] wakes up
+[1518-08-24 00:02] Guard #1733 begins shift
+[1518-03-23 00:58] wakes up
+[1518-11-15 23:52] Guard #1987 begins shift
+[1518-10-12 00:57] wakes up
+[1518-09-23 00:04] Guard #661 begins shift
+[1518-11-06 00:13] falls asleep
+[1518-09-25 00:43] falls asleep
+[1518-10-17 00:34] falls asleep
+[1518-06-21 00:03] falls asleep
+[1518-08-12 00:06] falls asleep
+[1518-04-06 00:50] wakes up
+[1518-04-15 00:50] wakes up
+[1518-10-15 00:01] Guard #2039 begins shift
+[1518-05-05 00:56] wakes up
+[1518-03-11 00:00] Guard #661 begins shift
+[1518-10-23 00:02] Guard #1867 begins shift
+[1518-09-25 00:48] wakes up
+[1518-03-06 00:03] Guard #1217 begins shift
+[1518-06-09 00:44] wakes up
+[1518-04-10 23:56] Guard #2347 begins shift
+[1518-10-05 00:00] Guard #2663 begins shift
+[1518-10-19 00:58] wakes up
+[1518-03-03 00:43] wakes up
+[1518-05-31 00:03] Guard #349 begins shift
+[1518-06-20 00:18] falls asleep
+[1518-07-14 00:53] wakes up
+[1518-03-28 00:02] Guard #1249 begins shift
+[1518-03-29 00:36] wakes up
+[1518-05-22 00:24] falls asleep
+[1518-05-23 00:49] wakes up
+[1518-03-09 00:01] Guard #2311 begins shift
+[1518-07-20 00:48] falls asleep
+[1518-02-28 00:44] wakes up
+[1518-03-17 00:29] falls asleep
+[1518-09-30 00:00] Guard #2347 begins shift
+[1518-03-11 00:11] falls asleep
+[1518-11-17 00:48] falls asleep
+[1518-05-07 00:38] falls asleep
+[1518-05-27 00:43] wakes up
+[1518-06-13 00:46] falls asleep
+[1518-05-26 00:58] wakes up
+[1518-05-04 00:04] Guard #2039 begins shift
+[1518-03-31 00:04] falls asleep
+[1518-06-29 00:37] wakes up
+[1518-06-21 00:44] wakes up
+[1518-04-06 00:00] Guard #661 begins shift
+[1518-04-09 00:04] falls asleep
+[1518-11-11 00:57] wakes up
+[1518-10-30 00:55] wakes up
+[1518-08-13 00:44] wakes up
+[1518-05-11 00:43] falls asleep
+[1518-04-23 00:06] falls asleep
+[1518-10-07 00:00] Guard #3541 begins shift
+[1518-04-09 00:35] falls asleep
+[1518-04-27 00:57] wakes up
+[1518-10-23 00:13] falls asleep
+[1518-11-14 00:33] wakes up
+[1518-04-13 00:29] wakes up
+[1518-10-04 00:39] falls asleep
+[1518-03-04 00:36] wakes up
+[1518-04-09 00:52] wakes up
+[1518-06-08 00:27] falls asleep
+[1518-10-08 23:56] Guard #191 begins shift
+[1518-04-07 00:54] wakes up
+[1518-10-29 00:30] falls asleep
+[1518-05-12 00:17] falls asleep
+[1518-05-01 00:23] falls asleep
+[1518-09-24 00:23] falls asleep
+[1518-04-11 00:47] falls asleep
+[1518-11-14 00:15] falls asleep
+[1518-07-27 00:33] falls asleep
+[1518-10-09 00:41] wakes up
+[1518-05-09 00:58] wakes up
+[1518-04-20 00:37] falls asleep
+[1518-08-03 00:12] wakes up
+[1518-10-12 00:45] falls asleep
+[1518-02-28 00:00] Guard #1987 begins shift
+[1518-07-15 00:54] falls asleep
+[1518-05-27 00:00] falls asleep
+[1518-06-01 00:42] wakes up
+[1518-08-03 23:57] Guard #1867 begins shift
+[1518-09-12 00:23] wakes up
+[1518-10-23 00:47] wakes up
+[1518-05-31 23:56] Guard #349 begins shift
+[1518-07-04 00:40] falls asleep
+[1518-03-09 23:56] Guard #1217 begins shift
+[1518-03-25 00:09] falls asleep
+[1518-08-24 00:08] falls asleep
+[1518-06-25 00:44] falls asleep
+[1518-07-21 00:56] wakes up
+[1518-07-23 00:04] Guard #509 begins shift
+[1518-06-28 00:48] falls asleep
+[1518-06-29 00:01] falls asleep
+[1518-10-17 00:50] wakes up
+[1518-06-05 00:34] wakes up
+[1518-04-07 00:17] falls asleep
+[1518-03-07 00:40] falls asleep
+[1518-04-20 00:53] wakes up
+[1518-05-02 23:59] Guard #509 begins shift
+[1518-07-22 00:55] falls asleep
+[1518-09-27 00:54] wakes up
+[1518-02-27 00:41] wakes up
+[1518-05-21 00:21] falls asleep
+[1518-10-02 00:22] falls asleep
+[1518-07-24 00:14] falls asleep
+[1518-08-13 23:59] Guard #211 begins shift
+[1518-06-08 00:55] wakes up
+[1518-06-13 00:02] Guard #509 begins shift
+[1518-08-21 00:48] falls asleep
+[1518-04-24 00:30] falls asleep
+[1518-05-21 00:00] Guard #191 begins shift
+[1518-08-15 00:52] falls asleep
+[1518-11-03 00:21] falls asleep
+[1518-08-10 00:26] falls asleep
+[1518-08-17 23:59] Guard #1453 begins shift
+[1518-08-19 23:56] Guard #661 begins shift
+[1518-07-10 00:47] falls asleep
+[1518-03-26 00:50] wakes up
+[1518-09-26 00:27] wakes up
+[1518-09-27 00:28] falls asleep
+[1518-10-12 00:02] falls asleep
+[1518-04-07 23:56] Guard #1987 begins shift
+[1518-06-07 00:32] wakes up
+[1518-07-01 00:58] wakes up
+[1518-08-26 00:46] falls asleep
+[1518-08-31 00:07] falls asleep
+[1518-10-23 00:57] wakes up
+[1518-05-12 00:33] wakes up
+[1518-07-22 00:37] falls asleep
+[1518-06-10 23:57] Guard #211 begins shift
+[1518-08-26 23:56] Guard #349 begins shift
+[1518-03-18 00:50] wakes up
+[1518-07-10 00:56] wakes up
+[1518-08-25 00:48] wakes up
+[1518-04-07 00:57] falls asleep
+[1518-08-06 23:56] Guard #2347 begins shift
+[1518-07-29 00:29] wakes up
+[1518-08-11 00:02] falls asleep
+[1518-11-02 00:56] falls asleep
+[1518-04-08 23:47] Guard #233 begins shift
+[1518-11-18 00:18] wakes up
+[1518-11-15 00:13] falls asleep
+[1518-06-26 00:14] falls asleep
+[1518-03-25 23:56] Guard #1249 begins shift
+[1518-08-26 00:57] wakes up
+[1518-04-27 00:15] falls asleep
+[1518-07-14 00:24] falls asleep
+[1518-05-21 00:37] wakes up
+[1518-06-19 23:59] Guard #877 begins shift
+[1518-08-30 00:47] wakes up
+[1518-08-20 00:28] falls asleep
+[1518-04-15 00:55] wakes up
+[1518-08-24 00:54] wakes up
+[1518-08-17 00:00] Guard #877 begins shift
+[1518-04-17 00:58] wakes up
+[1518-06-19 00:40] wakes up
+[1518-03-05 00:46] falls asleep
+[1518-10-24 00:52] wakes up
+[1518-10-08 00:04] Guard #1867 begins shift
+[1518-04-28 00:01] Guard #2663 begins shift
+[1518-06-17 00:50] wakes up
+[1518-08-05 00:52] wakes up
+[1518-09-09 00:59] wakes up
+[1518-11-11 23:51] Guard #1867 begins shift
+[1518-08-13 00:02] Guard #877 begins shift
+[1518-08-15 00:43] falls asleep
+[1518-10-16 00:47] wakes up
+[1518-11-10 00:24] falls asleep
+[1518-03-17 00:04] Guard #769 begins shift
+[1518-06-07 00:00] Guard #349 begins shift
+[1518-03-25 00:01] Guard #509 begins shift
+[1518-07-23 00:43] wakes up
+[1518-09-11 00:47] wakes up
+[1518-04-18 23:57] Guard #661 begins shift
+[1518-10-28 00:00] Guard #1733 begins shift
+[1518-03-18 00:02] Guard #2039 begins shift
+[1518-06-23 00:33] wakes up
+[1518-05-02 00:53] wakes up
+[1518-08-27 00:43] falls asleep
+[1518-04-12 00:35] wakes up
+[1518-11-17 00:49] wakes up
+[1518-05-09 00:23] falls asleep
+[1518-04-08 00:56] wakes up
+[1518-06-17 23:56] Guard #211 begins shift
+[1518-10-20 00:50] wakes up
+[1518-08-21 23:56] Guard #1733 begins shift
+[1518-08-29 00:35] falls asleep
+[1518-04-18 00:01] Guard #509 begins shift
+[1518-09-17 00:28] falls asleep
+[1518-10-01 00:32] falls asleep
+[1518-05-26 00:50] wakes up
+[1518-07-23 23:57] Guard #661 begins shift
+[1518-07-28 00:41] falls asleep
+[1518-08-16 00:35] wakes up
+[1518-06-01 00:35] falls asleep
+[1518-11-07 00:44] wakes up
+[1518-11-20 00:25] wakes up
+[1518-08-04 00:42] falls asleep
+[1518-09-21 00:02] Guard #809 begins shift
+[1518-04-28 00:49] wakes up
+[1518-10-15 00:57] wakes up
+[1518-05-27 23:58] Guard #349 begins shift
+[1518-04-19 00:38] wakes up
+[1518-10-13 00:56] wakes up
+[1518-08-11 00:47] wakes up
+[1518-06-17 00:33] falls asleep
+[1518-06-22 23:58] Guard #1867 begins shift
+[1518-10-18 00:58] wakes up
+[1518-05-14 00:11] falls asleep
+[1518-05-30 00:52] wakes up
+[1518-10-07 00:25] wakes up
+[1518-05-29 00:52] falls asleep
+[1518-03-28 00:38] falls asleep
+[1518-03-21 00:59] wakes up
+[1518-03-13 00:12] falls asleep
+[1518-07-13 00:00] Guard #1249 begins shift
+[1518-05-01 00:34] wakes up
+[1518-09-18 00:57] wakes up
+[1518-03-07 23:58] Guard #2039 begins shift
+[1518-10-06 00:48] wakes up
+[1518-09-06 00:10] falls asleep
+[1518-07-07 23:58] Guard #1321 begins shift
+[1518-07-07 00:02] falls asleep
+[1518-05-17 00:40] falls asleep
+[1518-10-27 00:30] wakes up
+[1518-09-25 00:05] falls asleep
+[1518-06-12 00:56] falls asleep
+[1518-07-20 00:57] wakes up
+[1518-03-12 00:37] wakes up
+[1518-09-10 00:53] wakes up
+[1518-05-24 23:51] Guard #349 begins shift
+[1518-03-01 00:57] falls asleep
+[1518-07-05 23:51] Guard #877 begins shift
diff --git a/2018/src/day4.rs b/2018/src/day4.rs
new file mode 100644
index 0000000..90cab72
--- /dev/null
+++ b/2018/src/day4.rs
@@ -0,0 +1,134 @@
+use std::io;
+use std::io::BufRead;
+use std::collections::HashMap;
+use std::cmp::max;
+use regex::Regex;
+
+#[derive(PartialEq, Eq, PartialOrd, Ord)]
+enum Action {
+ Begin(i32),
+ Sleep,
+ Wake
+}
+
+#[derive(PartialEq, Eq, PartialOrd, Ord)]
+struct Record {
+ year: i32,
+ month: i32,
+ day: i32,
+ hour: i32,
+ minute: i32,
+ action: Action
+}
+
+struct Guard {
+ id: i32,
+ sleep_times: Vec<(i32, i32)>, // inclusive-exclusive
+ asleep: [i32; 60]
+}
+
+fn parse_action(line: &str) -> Action {
+ if line.chars().next() == Some('G') {
+ let idx = 7 + line[7..].find(' ').unwrap();
+ Action::Begin(line[7 .. idx].parse().unwrap())
+ } else if line.chars().next() == Some('f') {
+ Action::Sleep
+ } else {
+ Action::Wake
+ }
+}
+
+fn parse_line(line: &str) -> Record {
+ lazy_static! {
+ static ref RE: Regex = Regex::new(r"^\[(\d+)-(\d+)-(\d+) (\d+):(\d+)\] (.*)$").unwrap();
+ }
+
+ let caps = RE.captures(line).unwrap();
+ Record {
+ year: caps.get(1).unwrap().as_str().parse().unwrap(),
+ month: caps.get(2).unwrap().as_str().parse().unwrap(),
+ day: caps.get(3).unwrap().as_str().parse().unwrap(),
+ hour: caps.get(4).unwrap().as_str().parse().unwrap(),
+ minute: caps.get(5).unwrap().as_str().parse().unwrap(),
+ action: parse_action(caps.get(6).unwrap().as_str())
+ }
+}
+
+fn argmax<T: Ord>(v: &[T]) -> Option<usize> {
+ if v.len() == 0 {
+ None
+ } else {
+ let mut maxat = 0;
+ for i in 1..v.len() {
+ if v[i] > v[maxat] {
+ maxat = i;
+ }
+ }
+ Some(maxat)
+ }
+}
+
+pub fn main<T: BufRead>(reader: T) -> io::Result<()> {
+ let mut records: Vec<Record> = reader.lines().map(|l| parse_line(&l.unwrap())).collect();
+
+ records.sort_unstable();
+ let mut guards = HashMap::new();
+
+ {
+ let mut current_id = 0;
+ let mut sleep_start = 0;
+
+ for record in records.iter() {
+ match record.action {
+ Action::Begin(id) => {
+ if let None = guards.get(&id) {
+ guards.insert(id, Guard {id: id, sleep_times: Vec::new(), asleep: [0; 60]});
+ }
+ current_id = id;
+ },
+ Action::Sleep => sleep_start = record.minute,
+ Action::Wake =>
+ guards.get_mut(&current_id).unwrap()
+ .sleep_times.push((sleep_start, record.minute))
+ }
+ }
+ }
+
+ let mut max_sleep = -1;
+ let mut max_sleep_at = -1;
+ let mut max_times = -1;
+ let mut max_times_at = -1;
+
+ for mut guard in guards.values_mut() {
+ let mut sleep = 0;
+ let mut times = 0;
+
+ for (from, to) in guard.sleep_times.iter() {
+ for i in *from..*to {
+ guard.asleep[i as usize] += 1;
+ times = max(times, guard.asleep[i as usize]);
+ }
+ sleep += to - from;
+ }
+
+ if sleep > max_sleep {
+ max_sleep = sleep;
+ max_sleep_at = guard.id;
+ }
+
+ if times > max_times {
+ max_times = times;
+ max_times_at = guard.id;
+ }
+ }
+
+ let sleepy_guard = guards.get(&max_sleep_at).unwrap();
+ let max_minute = argmax(&sleepy_guard.asleep).unwrap() as i32;
+ println!("{}", max_minute * sleepy_guard.id);
+
+ let consistent_guard = guards.get(&max_times_at).unwrap();
+ let max_minute = argmax(&consistent_guard.asleep).unwrap() as i32;
+ println!("{}", max_minute * consistent_guard.id);
+
+ Ok(())
+}
diff --git a/2018/src/main.rs b/2018/src/main.rs
index 349d857..98c0f7b 100644
--- a/2018/src/main.rs
+++ b/2018/src/main.rs
@@ -1,3 +1,5 @@
+#[macro_use] extern crate lazy_static;
+extern crate regex;
extern crate argparse;
use std::io;
@@ -9,12 +11,14 @@ use argparse::{ArgumentParser, StoreTrue, Store};
mod day1;
mod day2;
mod day3;
+mod day4;
fn day_switch<T: BufRead>(day: i32, reader: T) -> io::Result<()> {
match day {
1 => day1::main(reader),
2 => day2::main(reader),
3 => day3::main(reader),
+ 4 => day4::main(reader),
_ => Err(Error::new(ErrorKind::Other, "Invalid day"))
}
}
@@ -70,7 +74,7 @@ fn main() -> io::Result<()> {
error_handler(||
if day_string.len() == 0 {
- for day in 1..4 {
+ for day in 1..5 {
run_day(day, &options)?;
}
Ok(())