Compare commits
No commits in common. "5b65e8ec710f044e6f9b9d50eb812d4726b8d112" and "d2b1742d7235abeff30329f241fb101b8124425c" have entirely different histories.
5b65e8ec71
...
d2b1742d72
53
2021/Cargo.lock
generated
53
2021/Cargo.lock
generated
@ -6,20 +6,9 @@ version = 3
|
|||||||
name = "advent2021"
|
name = "advent2021"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term",
|
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"aoc-runner",
|
"aoc-runner",
|
||||||
"aoc-runner-derive",
|
"aoc-runner-derive",
|
||||||
"thiserror",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ansi_term"
|
|
||||||
version = "0.12.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
|
|
||||||
dependencies = [
|
|
||||||
"winapi",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -126,50 +115,8 @@ dependencies = [
|
|||||||
"unicode-xid",
|
"unicode-xid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "thiserror"
|
|
||||||
version = "1.0.30"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
|
|
||||||
dependencies = [
|
|
||||||
"thiserror-impl",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "thiserror-impl"
|
|
||||||
version = "1.0.30"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-xid"
|
name = "unicode-xid"
|
||||||
version = "0.2.2"
|
version = "0.2.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "winapi"
|
|
||||||
version = "0.3.9"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
|
||||||
dependencies = [
|
|
||||||
"winapi-i686-pc-windows-gnu",
|
|
||||||
"winapi-x86_64-pc-windows-gnu",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "winapi-i686-pc-windows-gnu"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "winapi-x86_64-pc-windows-gnu"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|
||||||
|
|||||||
@ -6,8 +6,6 @@ edition = "2021"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ansi_term = "0.12.1"
|
|
||||||
anyhow = "1.0.45"
|
anyhow = "1.0.45"
|
||||||
aoc-runner = "0.3.0"
|
aoc-runner = "0.3.0"
|
||||||
aoc-runner-derive = "0.3.0"
|
aoc-runner-derive = "0.3.0"
|
||||||
thiserror = "1.0.30"
|
|
||||||
|
|||||||
@ -1,601 +0,0 @@
|
|||||||
72,99,88,8,59,61,96,92,2,70,1,32,18,10,95,33,20,31,66,43,26,24,91,44,11,15,48,90,27,29,14,68,3,50,69,74,54,4,16,55,64,12,73,80,58,83,6,87,30,41,25,39,93,60,9,81,63,75,46,19,78,51,21,28,94,7,17,42,53,13,97,98,34,76,89,23,86,52,79,85,67,84,47,22,37,65,71,49,82,40,77,36,62,0,56,45,57,38,35,5
|
|
||||||
|
|
||||||
91 60 70 64 83
|
|
||||||
35 41 79 55 31
|
|
||||||
7 58 25 3 47
|
|
||||||
2 23 69 59 21
|
|
||||||
11 22 8 87 90
|
|
||||||
|
|
||||||
77 95 19 21 76
|
|
||||||
93 92 62 35 3
|
|
||||||
4 29 7 41 45
|
|
||||||
80 50 83 61 64
|
|
||||||
39 32 91 56 48
|
|
||||||
|
|
||||||
47 11 39 58 97
|
|
||||||
63 51 40 74 71
|
|
||||||
12 17 68 81 44
|
|
||||||
64 85 20 84 80
|
|
||||||
0 77 5 18 50
|
|
||||||
|
|
||||||
44 82 32 1 57
|
|
||||||
98 88 33 83 85
|
|
||||||
25 61 63 99 37
|
|
||||||
0 74 7 20 39
|
|
||||||
71 72 22 80 28
|
|
||||||
|
|
||||||
78 97 0 48 41
|
|
||||||
56 51 62 58 90
|
|
||||||
8 44 98 46 1
|
|
||||||
38 40 91 20 55
|
|
||||||
88 2 32 86 14
|
|
||||||
|
|
||||||
84 50 16 45 40
|
|
||||||
9 39 60 34 46
|
|
||||||
57 20 12 3 36
|
|
||||||
58 17 72 48 83
|
|
||||||
73 85 49 67 66
|
|
||||||
|
|
||||||
4 30 73 83 57
|
|
||||||
74 23 49 19 42
|
|
||||||
72 65 8 99 13
|
|
||||||
25 6 82 53 68
|
|
||||||
20 86 46 48 50
|
|
||||||
|
|
||||||
52 29 61 16 75
|
|
||||||
36 19 2 82 9
|
|
||||||
34 90 89 43 14
|
|
||||||
69 66 20 21 11
|
|
||||||
31 53 46 18 23
|
|
||||||
|
|
||||||
37 76 34 79 99
|
|
||||||
43 5 42 91 71
|
|
||||||
47 54 19 82 81
|
|
||||||
95 78 65 60 24
|
|
||||||
32 94 92 27 66
|
|
||||||
|
|
||||||
68 61 80 90 53
|
|
||||||
33 17 52 0 23
|
|
||||||
30 71 5 85 11
|
|
||||||
27 39 41 6 9
|
|
||||||
58 98 7 74 89
|
|
||||||
|
|
||||||
31 5 55 67 51
|
|
||||||
54 86 40 25 92
|
|
||||||
91 62 9 94 7
|
|
||||||
39 0 44 52 28
|
|
||||||
12 17 26 46 32
|
|
||||||
|
|
||||||
94 80 83 88 77
|
|
||||||
65 71 31 86 0
|
|
||||||
98 55 18 92 72
|
|
||||||
6 12 30 25 34
|
|
||||||
67 53 14 20 47
|
|
||||||
|
|
||||||
81 74 14 47 1
|
|
||||||
83 82 4 89 8
|
|
||||||
43 93 63 21 44
|
|
||||||
92 61 25 77 97
|
|
||||||
12 72 35 78 52
|
|
||||||
|
|
||||||
26 39 13 37 46
|
|
||||||
87 6 58 47 19
|
|
||||||
24 35 45 95 52
|
|
||||||
5 27 42 96 0
|
|
||||||
23 64 8 29 83
|
|
||||||
|
|
||||||
53 58 18 96 93
|
|
||||||
57 90 35 88 68
|
|
||||||
91 89 7 80 47
|
|
||||||
59 86 81 24 31
|
|
||||||
43 8 66 17 94
|
|
||||||
|
|
||||||
0 97 91 67 90
|
|
||||||
93 20 36 4 42
|
|
||||||
43 64 28 94 34
|
|
||||||
31 2 7 54 71
|
|
||||||
18 35 76 86 16
|
|
||||||
|
|
||||||
55 63 26 47 0
|
|
||||||
2 23 54 25 90
|
|
||||||
36 13 85 31 15
|
|
||||||
59 51 18 88 62
|
|
||||||
44 69 9 81 58
|
|
||||||
|
|
||||||
26 97 98 42 27
|
|
||||||
3 53 91 89 93
|
|
||||||
87 57 12 18 5
|
|
||||||
29 99 86 47 64
|
|
||||||
6 28 92 79 67
|
|
||||||
|
|
||||||
4 35 45 79 16
|
|
||||||
33 95 99 80 9
|
|
||||||
60 78 57 51 50
|
|
||||||
27 5 48 21 46
|
|
||||||
19 70 32 58 18
|
|
||||||
|
|
||||||
94 82 61 66 31
|
|
||||||
14 56 76 37 28
|
|
||||||
42 81 50 10 40
|
|
||||||
2 98 47 29 62
|
|
||||||
69 90 46 44 18
|
|
||||||
|
|
||||||
87 3 8 50 17
|
|
||||||
15 90 54 45 21
|
|
||||||
6 28 43 51 32
|
|
||||||
97 84 69 30 38
|
|
||||||
98 44 88 55 83
|
|
||||||
|
|
||||||
34 19 27 43 92
|
|
||||||
81 62 52 32 39
|
|
||||||
50 29 83 25 82
|
|
||||||
60 55 49 41 97
|
|
||||||
75 94 22 69 66
|
|
||||||
|
|
||||||
59 39 96 87 65
|
|
||||||
33 18 4 71 15
|
|
||||||
22 27 92 8 29
|
|
||||||
19 5 32 85 45
|
|
||||||
91 79 35 9 3
|
|
||||||
|
|
||||||
41 53 51 68 85
|
|
||||||
72 71 94 82 81
|
|
||||||
60 38 13 16 7
|
|
||||||
49 80 10 0 54
|
|
||||||
20 39 59 64 99
|
|
||||||
|
|
||||||
37 21 90 40 73
|
|
||||||
85 75 16 34 99
|
|
||||||
84 15 25 18 27
|
|
||||||
77 32 0 76 36
|
|
||||||
13 50 68 91 12
|
|
||||||
|
|
||||||
24 26 0 14 12
|
|
||||||
89 4 15 95 73
|
|
||||||
54 2 55 84 42
|
|
||||||
30 50 81 60 87
|
|
||||||
37 94 71 91 53
|
|
||||||
|
|
||||||
52 1 81 44 34
|
|
||||||
27 60 36 19 69
|
|
||||||
98 11 49 67 56
|
|
||||||
77 72 40 48 66
|
|
||||||
84 9 37 32 51
|
|
||||||
|
|
||||||
58 15 7 36 55
|
|
||||||
94 49 69 89 87
|
|
||||||
79 70 30 77 19
|
|
||||||
68 31 56 41 53
|
|
||||||
47 85 74 54 46
|
|
||||||
|
|
||||||
64 87 23 66 0
|
|
||||||
29 98 72 82 80
|
|
||||||
70 45 46 30 37
|
|
||||||
53 54 33 86 76
|
|
||||||
6 75 71 68 2
|
|
||||||
|
|
||||||
12 31 43 80 41
|
|
||||||
37 15 13 2 3
|
|
||||||
86 61 9 17 59
|
|
||||||
55 68 72 8 1
|
|
||||||
96 26 44 73 47
|
|
||||||
|
|
||||||
67 39 95 84 10
|
|
||||||
5 88 13 81 99
|
|
||||||
68 15 98 6 17
|
|
||||||
47 85 74 32 97
|
|
||||||
58 8 16 56 42
|
|
||||||
|
|
||||||
82 31 42 84 17
|
|
||||||
25 28 2 6 12
|
|
||||||
78 57 16 97 18
|
|
||||||
87 64 54 30 65
|
|
||||||
3 77 29 49 81
|
|
||||||
|
|
||||||
24 1 43 89 46
|
|
||||||
29 78 57 14 85
|
|
||||||
9 58 53 83 35
|
|
||||||
96 42 62 68 74
|
|
||||||
67 2 39 37 51
|
|
||||||
|
|
||||||
72 26 46 52 3
|
|
||||||
91 27 41 32 53
|
|
||||||
25 36 7 63 22
|
|
||||||
56 38 93 65 9
|
|
||||||
95 19 77 64 44
|
|
||||||
|
|
||||||
21 71 13 99 39
|
|
||||||
47 17 80 85 64
|
|
||||||
5 18 48 27 81
|
|
||||||
82 23 45 57 12
|
|
||||||
83 55 26 31 32
|
|
||||||
|
|
||||||
57 13 86 69 65
|
|
||||||
42 76 35 18 39
|
|
||||||
17 91 95 43 6
|
|
||||||
55 97 22 54 14
|
|
||||||
56 0 5 60 92
|
|
||||||
|
|
||||||
87 12 46 42 35
|
|
||||||
44 6 95 30 67
|
|
||||||
51 21 68 37 59
|
|
||||||
77 65 50 69 63
|
|
||||||
33 56 24 57 28
|
|
||||||
|
|
||||||
82 87 42 99 39
|
|
||||||
38 55 74 28 6
|
|
||||||
77 66 9 80 10
|
|
||||||
47 90 32 3 98
|
|
||||||
92 52 5 94 51
|
|
||||||
|
|
||||||
16 1 87 57 66
|
|
||||||
41 70 58 31 5
|
|
||||||
71 88 17 42 76
|
|
||||||
81 40 25 89 63
|
|
||||||
92 4 61 77 64
|
|
||||||
|
|
||||||
70 28 56 51 66
|
|
||||||
44 60 25 0 45
|
|
||||||
91 78 81 95 88
|
|
||||||
75 43 57 67 32
|
|
||||||
58 27 20 82 22
|
|
||||||
|
|
||||||
16 98 82 79 90
|
|
||||||
96 4 80 69 19
|
|
||||||
9 28 33 40 94
|
|
||||||
2 99 14 73 43
|
|
||||||
76 68 74 42 30
|
|
||||||
|
|
||||||
29 42 94 45 2
|
|
||||||
25 81 46 54 26
|
|
||||||
75 99 51 58 23
|
|
||||||
76 72 71 64 63
|
|
||||||
66 70 92 44 13
|
|
||||||
|
|
||||||
2 71 39 49 95
|
|
||||||
19 84 1 7 96
|
|
||||||
9 6 60 93 78
|
|
||||||
38 91 55 36 41
|
|
||||||
64 3 10 20 74
|
|
||||||
|
|
||||||
79 80 15 69 89
|
|
||||||
36 76 83 7 72
|
|
||||||
87 34 48 0 93
|
|
||||||
5 84 77 20 75
|
|
||||||
46 27 11 55 3
|
|
||||||
|
|
||||||
82 34 4 14 74
|
|
||||||
40 39 7 6 95
|
|
||||||
11 51 78 80 29
|
|
||||||
97 81 38 9 71
|
|
||||||
22 62 19 72 68
|
|
||||||
|
|
||||||
54 70 90 43 98
|
|
||||||
12 27 57 96 62
|
|
||||||
32 76 0 86 42
|
|
||||||
88 68 81 91 50
|
|
||||||
10 94 18 71 2
|
|
||||||
|
|
||||||
90 41 29 53 58
|
|
||||||
59 62 14 85 66
|
|
||||||
25 82 68 44 93
|
|
||||||
73 32 76 67 18
|
|
||||||
94 71 83 34 37
|
|
||||||
|
|
||||||
6 72 69 33 90
|
|
||||||
87 60 66 85 16
|
|
||||||
59 80 86 47 89
|
|
||||||
32 98 17 29 5
|
|
||||||
48 27 18 57 81
|
|
||||||
|
|
||||||
10 22 98 86 82
|
|
||||||
8 66 71 14 93
|
|
||||||
87 79 40 78 49
|
|
||||||
84 63 17 54 94
|
|
||||||
35 39 47 1 96
|
|
||||||
|
|
||||||
58 60 52 6 86
|
|
||||||
41 20 66 59 2
|
|
||||||
92 79 88 40 71
|
|
||||||
96 9 25 36 17
|
|
||||||
91 32 43 38 8
|
|
||||||
|
|
||||||
74 3 64 66 68
|
|
||||||
69 37 22 76 33
|
|
||||||
17 67 29 32 27
|
|
||||||
63 49 46 21 60
|
|
||||||
35 73 9 52 50
|
|
||||||
|
|
||||||
0 91 8 26 9
|
|
||||||
3 98 79 97 7
|
|
||||||
37 61 1 60 47
|
|
||||||
86 17 11 70 15
|
|
||||||
66 53 2 90 54
|
|
||||||
|
|
||||||
68 42 0 78 16
|
|
||||||
83 88 21 87 12
|
|
||||||
50 2 29 14 63
|
|
||||||
72 90 81 71 91
|
|
||||||
54 79 94 10 4
|
|
||||||
|
|
||||||
28 63 97 31 4
|
|
||||||
50 52 43 24 16
|
|
||||||
36 77 0 9 75
|
|
||||||
83 94 69 68 27
|
|
||||||
93 82 42 56 34
|
|
||||||
|
|
||||||
24 52 66 51 82
|
|
||||||
50 30 34 93 67
|
|
||||||
56 70 53 13 78
|
|
||||||
4 84 88 57 81
|
|
||||||
80 74 5 95 98
|
|
||||||
|
|
||||||
56 64 53 52 72
|
|
||||||
51 48 50 60 49
|
|
||||||
8 46 84 95 43
|
|
||||||
91 21 7 88 33
|
|
||||||
94 57 80 25 54
|
|
||||||
|
|
||||||
70 57 62 20 18
|
|
||||||
86 45 41 76 32
|
|
||||||
87 35 52 5 2
|
|
||||||
16 77 25 39 22
|
|
||||||
38 10 6 29 98
|
|
||||||
|
|
||||||
89 54 57 80 65
|
|
||||||
0 38 94 15 6
|
|
||||||
85 76 16 83 59
|
|
||||||
92 5 53 14 95
|
|
||||||
47 35 73 98 34
|
|
||||||
|
|
||||||
64 24 90 71 69
|
|
||||||
55 35 20 98 41
|
|
||||||
94 70 10 73 16
|
|
||||||
65 84 60 7 72
|
|
||||||
83 2 22 78 99
|
|
||||||
|
|
||||||
31 81 74 56 98
|
|
||||||
13 97 95 49 67
|
|
||||||
9 47 42 99 60
|
|
||||||
38 22 65 58 21
|
|
||||||
82 45 2 28 68
|
|
||||||
|
|
||||||
90 88 28 85 51
|
|
||||||
23 93 13 55 50
|
|
||||||
63 22 3 30 39
|
|
||||||
5 71 82 95 81
|
|
||||||
57 76 12 92 56
|
|
||||||
|
|
||||||
78 12 28 6 73
|
|
||||||
59 24 43 29 31
|
|
||||||
30 34 75 52 48
|
|
||||||
62 57 23 74 50
|
|
||||||
91 92 5 95 38
|
|
||||||
|
|
||||||
95 88 13 22 10
|
|
||||||
16 4 19 37 91
|
|
||||||
50 52 60 46 77
|
|
||||||
45 55 49 41 26
|
|
||||||
21 7 67 48 18
|
|
||||||
|
|
||||||
51 79 44 16 71
|
|
||||||
6 13 12 41 97
|
|
||||||
50 25 19 63 4
|
|
||||||
98 0 23 77 31
|
|
||||||
27 57 52 99 3
|
|
||||||
|
|
||||||
86 95 7 54 84
|
|
||||||
50 33 48 16 9
|
|
||||||
82 32 38 6 34
|
|
||||||
43 80 27 37 11
|
|
||||||
89 70 41 22 45
|
|
||||||
|
|
||||||
24 3 47 68 35
|
|
||||||
85 76 8 29 4
|
|
||||||
2 10 5 28 73
|
|
||||||
92 89 50 25 56
|
|
||||||
99 57 79 19 37
|
|
||||||
|
|
||||||
0 46 72 5 20
|
|
||||||
62 28 24 53 44
|
|
||||||
84 25 63 34 9
|
|
||||||
75 1 65 59 10
|
|
||||||
95 29 97 77 45
|
|
||||||
|
|
||||||
87 90 1 17 67
|
|
||||||
57 73 35 10 30
|
|
||||||
65 14 46 60 6
|
|
||||||
70 66 56 69 92
|
|
||||||
3 27 21 64 88
|
|
||||||
|
|
||||||
20 58 53 29 66
|
|
||||||
27 6 67 89 33
|
|
||||||
88 60 79 69 97
|
|
||||||
90 3 47 68 25
|
|
||||||
48 59 42 98 39
|
|
||||||
|
|
||||||
65 90 45 97 87
|
|
||||||
75 98 7 58 42
|
|
||||||
51 4 95 88 47
|
|
||||||
94 6 11 53 63
|
|
||||||
49 80 2 48 68
|
|
||||||
|
|
||||||
3 77 42 97 82
|
|
||||||
70 58 81 18 47
|
|
||||||
78 96 62 39 56
|
|
||||||
22 87 71 31 94
|
|
||||||
34 48 57 38 88
|
|
||||||
|
|
||||||
70 36 65 33 45
|
|
||||||
71 0 59 44 1
|
|
||||||
42 37 7 5 9
|
|
||||||
11 12 91 43 27
|
|
||||||
60 21 57 61 99
|
|
||||||
|
|
||||||
76 75 56 49 2
|
|
||||||
36 57 39 64 77
|
|
||||||
95 19 35 43 97
|
|
||||||
82 34 50 44 55
|
|
||||||
45 74 15 66 29
|
|
||||||
|
|
||||||
0 75 1 78 79
|
|
||||||
13 37 48 27 14
|
|
||||||
90 50 26 92 67
|
|
||||||
89 62 87 69 33
|
|
||||||
29 47 4 2 12
|
|
||||||
|
|
||||||
74 42 24 86 61
|
|
||||||
92 66 3 65 75
|
|
||||||
7 1 77 63 64
|
|
||||||
39 91 87 28 5
|
|
||||||
30 35 41 73 96
|
|
||||||
|
|
||||||
0 81 41 15 66
|
|
||||||
62 19 86 31 40
|
|
||||||
23 94 98 82 24
|
|
||||||
61 99 1 5 60
|
|
||||||
80 64 91 33 47
|
|
||||||
|
|
||||||
16 61 56 77 57
|
|
||||||
28 59 71 45 92
|
|
||||||
53 20 35 66 73
|
|
||||||
99 3 86 31 74
|
|
||||||
94 69 84 96 90
|
|
||||||
|
|
||||||
71 56 23 76 42
|
|
||||||
90 44 58 27 15
|
|
||||||
46 18 86 63 24
|
|
||||||
69 49 82 38 43
|
|
||||||
33 51 60 66 39
|
|
||||||
|
|
||||||
75 78 38 25 76
|
|
||||||
67 3 83 90 10
|
|
||||||
40 89 47 23 88
|
|
||||||
34 21 46 16 33
|
|
||||||
9 79 50 0 26
|
|
||||||
|
|
||||||
81 75 80 23 41
|
|
||||||
62 4 76 1 63
|
|
||||||
56 39 57 28 61
|
|
||||||
20 6 79 92 84
|
|
||||||
88 3 90 16 12
|
|
||||||
|
|
||||||
87 78 3 34 63
|
|
||||||
98 21 24 9 99
|
|
||||||
62 29 57 65 27
|
|
||||||
47 52 67 76 71
|
|
||||||
11 17 93 23 82
|
|
||||||
|
|
||||||
53 68 70 38 56
|
|
||||||
62 54 25 43 35
|
|
||||||
9 3 13 15 75
|
|
||||||
59 27 26 33 83
|
|
||||||
93 40 11 64 76
|
|
||||||
|
|
||||||
27 83 26 48 77
|
|
||||||
51 20 65 18 35
|
|
||||||
80 30 60 44 89
|
|
||||||
84 82 62 91 63
|
|
||||||
12 97 11 19 34
|
|
||||||
|
|
||||||
31 28 92 48 34
|
|
||||||
9 93 61 71 60
|
|
||||||
52 18 97 81 62
|
|
||||||
80 64 57 22 30
|
|
||||||
11 88 74 29 56
|
|
||||||
|
|
||||||
57 34 90 46 73
|
|
||||||
31 0 70 66 82
|
|
||||||
45 12 40 19 87
|
|
||||||
91 24 59 83 14
|
|
||||||
80 21 13 86 89
|
|
||||||
|
|
||||||
9 8 64 48 30
|
|
||||||
6 62 28 99 41
|
|
||||||
79 45 83 7 55
|
|
||||||
15 14 54 88 12
|
|
||||||
90 74 97 96 50
|
|
||||||
|
|
||||||
50 73 58 26 12
|
|
||||||
96 98 56 34 7
|
|
||||||
51 92 14 89 16
|
|
||||||
41 70 80 55 13
|
|
||||||
37 47 2 64 99
|
|
||||||
|
|
||||||
98 9 70 17 18
|
|
||||||
39 15 88 16 47
|
|
||||||
80 41 8 51 21
|
|
||||||
54 42 31 10 59
|
|
||||||
37 92 33 62 68
|
|
||||||
|
|
||||||
60 72 51 63 29
|
|
||||||
83 39 41 24 14
|
|
||||||
34 5 94 90 56
|
|
||||||
75 80 67 17 20
|
|
||||||
47 11 58 93 42
|
|
||||||
|
|
||||||
97 7 27 42 67
|
|
||||||
12 30 91 45 52
|
|
||||||
62 50 87 92 71
|
|
||||||
99 84 33 6 46
|
|
||||||
29 55 86 47 60
|
|
||||||
|
|
||||||
25 49 55 98 22
|
|
||||||
66 9 61 59 90
|
|
||||||
45 74 77 88 5
|
|
||||||
6 76 0 36 93
|
|
||||||
23 70 33 95 2
|
|
||||||
|
|
||||||
53 92 27 86 55
|
|
||||||
66 52 26 58 38
|
|
||||||
2 78 69 62 65
|
|
||||||
30 5 1 25 99
|
|
||||||
76 43 4 13 8
|
|
||||||
|
|
||||||
18 72 51 48 39
|
|
||||||
62 19 28 44 82
|
|
||||||
54 22 38 55 83
|
|
||||||
86 93 42 9 32
|
|
||||||
11 89 27 34 68
|
|
||||||
|
|
||||||
85 99 35 88 76
|
|
||||||
10 25 33 83 70
|
|
||||||
54 81 77 73 66
|
|
||||||
4 74 96 41 86
|
|
||||||
49 3 68 65 39
|
|
||||||
|
|
||||||
71 0 70 14 31
|
|
||||||
28 23 17 43 75
|
|
||||||
13 40 38 87 97
|
|
||||||
63 93 92 89 27
|
|
||||||
58 76 24 53 54
|
|
||||||
|
|
||||||
55 58 11 38 16
|
|
||||||
98 86 13 12 8
|
|
||||||
22 10 77 61 90
|
|
||||||
37 76 2 62 45
|
|
||||||
44 30 52 70 82
|
|
||||||
|
|
||||||
89 55 12 90 63
|
|
||||||
40 88 91 22 74
|
|
||||||
8 0 25 6 79
|
|
||||||
53 23 87 77 20
|
|
||||||
11 38 78 43 94
|
|
||||||
|
|
||||||
21 14 37 8 16
|
|
||||||
29 73 67 91 56
|
|
||||||
5 90 12 92 59
|
|
||||||
64 1 42 72 94
|
|
||||||
98 86 18 69 49
|
|
||||||
|
|
||||||
79 71 82 1 77
|
|
||||||
96 39 24 60 81
|
|
||||||
49 16 12 63 14
|
|
||||||
0 32 78 37 8
|
|
||||||
92 33 15 99 65
|
|
||||||
|
|
||||||
54 11 40 55 33
|
|
||||||
58 47 4 83 94
|
|
||||||
46 96 16 28 5
|
|
||||||
0 62 95 71 39
|
|
||||||
93 59 7 75 64
|
|
||||||
@ -1,500 +0,0 @@
|
|||||||
217,490 -> 217,764
|
|
||||||
44,270 -> 373,599
|
|
||||||
440,139 -> 440,303
|
|
||||||
161,663 -> 345,663
|
|
||||||
848,963 -> 908,963
|
|
||||||
299,207 -> 162,70
|
|
||||||
77,346 -> 77,686
|
|
||||||
693,743 -> 693,127
|
|
||||||
96,459 -> 96,779
|
|
||||||
864,39 -> 233,670
|
|
||||||
58,79 -> 203,79
|
|
||||||
158,596 -> 463,291
|
|
||||||
633,293 -> 136,293
|
|
||||||
656,474 -> 656,72
|
|
||||||
148,754 -> 947,754
|
|
||||||
535,780 -> 535,460
|
|
||||||
821,701 -> 821,796
|
|
||||||
592,200 -> 592,610
|
|
||||||
620,786 -> 722,786
|
|
||||||
632,731 -> 536,731
|
|
||||||
825,640 -> 195,10
|
|
||||||
956,547 -> 956,387
|
|
||||||
25,32 -> 981,988
|
|
||||||
870,613 -> 870,16
|
|
||||||
369,780 -> 369,362
|
|
||||||
348,924 -> 243,924
|
|
||||||
28,114 -> 540,114
|
|
||||||
702,690 -> 702,335
|
|
||||||
836,442 -> 184,442
|
|
||||||
602,11 -> 602,651
|
|
||||||
76,988 -> 608,988
|
|
||||||
15,922 -> 951,922
|
|
||||||
363,18 -> 296,18
|
|
||||||
130,580 -> 516,580
|
|
||||||
799,335 -> 858,335
|
|
||||||
571,842 -> 571,800
|
|
||||||
684,654 -> 684,971
|
|
||||||
815,674 -> 66,674
|
|
||||||
575,612 -> 575,919
|
|
||||||
652,126 -> 822,296
|
|
||||||
391,493 -> 730,493
|
|
||||||
810,479 -> 810,807
|
|
||||||
397,420 -> 780,37
|
|
||||||
187,740 -> 869,740
|
|
||||||
175,626 -> 175,169
|
|
||||||
773,901 -> 773,44
|
|
||||||
45,130 -> 45,17
|
|
||||||
226,253 -> 252,279
|
|
||||||
481,928 -> 481,521
|
|
||||||
121,506 -> 121,50
|
|
||||||
306,386 -> 653,733
|
|
||||||
115,635 -> 208,542
|
|
||||||
619,67 -> 212,67
|
|
||||||
82,79 -> 972,969
|
|
||||||
15,20 -> 15,933
|
|
||||||
606,136 -> 500,136
|
|
||||||
791,250 -> 791,316
|
|
||||||
128,931 -> 781,278
|
|
||||||
11,365 -> 11,226
|
|
||||||
705,326 -> 57,326
|
|
||||||
778,632 -> 173,27
|
|
||||||
121,624 -> 121,737
|
|
||||||
30,815 -> 909,815
|
|
||||||
18,114 -> 869,965
|
|
||||||
554,741 -> 554,771
|
|
||||||
284,826 -> 945,826
|
|
||||||
386,654 -> 295,654
|
|
||||||
235,848 -> 418,848
|
|
||||||
536,59 -> 497,59
|
|
||||||
156,922 -> 29,922
|
|
||||||
57,718 -> 174,718
|
|
||||||
964,774 -> 964,426
|
|
||||||
729,950 -> 729,254
|
|
||||||
896,117 -> 152,861
|
|
||||||
603,919 -> 603,776
|
|
||||||
176,472 -> 573,472
|
|
||||||
25,970 -> 939,56
|
|
||||||
478,482 -> 38,482
|
|
||||||
155,936 -> 956,135
|
|
||||||
351,621 -> 133,403
|
|
||||||
513,323 -> 103,323
|
|
||||||
679,167 -> 679,983
|
|
||||||
910,456 -> 241,456
|
|
||||||
16,266 -> 16,829
|
|
||||||
338,791 -> 973,156
|
|
||||||
564,73 -> 564,676
|
|
||||||
196,800 -> 339,800
|
|
||||||
15,776 -> 973,776
|
|
||||||
719,134 -> 719,775
|
|
||||||
730,692 -> 272,692
|
|
||||||
247,770 -> 244,770
|
|
||||||
853,720 -> 940,720
|
|
||||||
685,379 -> 873,379
|
|
||||||
944,647 -> 944,206
|
|
||||||
67,974 -> 967,74
|
|
||||||
828,194 -> 355,194
|
|
||||||
596,522 -> 596,169
|
|
||||||
677,970 -> 638,970
|
|
||||||
587,427 -> 587,354
|
|
||||||
804,488 -> 469,153
|
|
||||||
355,653 -> 787,221
|
|
||||||
798,873 -> 133,873
|
|
||||||
565,798 -> 534,829
|
|
||||||
239,273 -> 20,273
|
|
||||||
942,138 -> 398,138
|
|
||||||
499,743 -> 958,284
|
|
||||||
913,466 -> 514,466
|
|
||||||
504,705 -> 504,983
|
|
||||||
455,863 -> 451,863
|
|
||||||
638,255 -> 425,255
|
|
||||||
338,724 -> 338,457
|
|
||||||
147,880 -> 928,99
|
|
||||||
11,955 -> 806,160
|
|
||||||
566,961 -> 231,961
|
|
||||||
870,560 -> 611,560
|
|
||||||
714,925 -> 859,925
|
|
||||||
484,946 -> 905,946
|
|
||||||
112,394 -> 266,394
|
|
||||||
191,728 -> 191,635
|
|
||||||
983,806 -> 217,40
|
|
||||||
575,286 -> 730,286
|
|
||||||
366,323 -> 366,211
|
|
||||||
383,990 -> 834,990
|
|
||||||
834,976 -> 26,168
|
|
||||||
819,492 -> 819,648
|
|
||||||
257,522 -> 257,199
|
|
||||||
756,176 -> 244,176
|
|
||||||
165,199 -> 569,199
|
|
||||||
896,943 -> 18,65
|
|
||||||
986,642 -> 354,10
|
|
||||||
864,381 -> 349,381
|
|
||||||
177,982 -> 977,182
|
|
||||||
458,254 -> 458,920
|
|
||||||
550,322 -> 550,297
|
|
||||||
956,748 -> 270,62
|
|
||||||
412,305 -> 292,305
|
|
||||||
201,571 -> 375,571
|
|
||||||
608,139 -> 608,330
|
|
||||||
646,718 -> 432,504
|
|
||||||
449,325 -> 449,115
|
|
||||||
315,971 -> 955,331
|
|
||||||
248,143 -> 477,143
|
|
||||||
956,858 -> 111,13
|
|
||||||
776,608 -> 739,608
|
|
||||||
44,842 -> 548,842
|
|
||||||
590,487 -> 590,792
|
|
||||||
978,127 -> 978,748
|
|
||||||
620,948 -> 852,948
|
|
||||||
67,403 -> 67,122
|
|
||||||
340,256 -> 346,256
|
|
||||||
803,58 -> 474,387
|
|
||||||
876,448 -> 876,55
|
|
||||||
78,288 -> 565,288
|
|
||||||
235,80 -> 480,80
|
|
||||||
949,880 -> 949,666
|
|
||||||
529,734 -> 529,332
|
|
||||||
780,973 -> 780,824
|
|
||||||
900,279 -> 698,279
|
|
||||||
290,438 -> 34,694
|
|
||||||
766,569 -> 766,443
|
|
||||||
729,690 -> 729,137
|
|
||||||
72,938 -> 72,893
|
|
||||||
960,563 -> 960,322
|
|
||||||
669,293 -> 578,293
|
|
||||||
396,388 -> 984,388
|
|
||||||
675,694 -> 211,230
|
|
||||||
152,743 -> 63,743
|
|
||||||
203,660 -> 391,660
|
|
||||||
582,806 -> 906,806
|
|
||||||
698,837 -> 698,483
|
|
||||||
869,320 -> 595,594
|
|
||||||
283,817 -> 283,861
|
|
||||||
919,926 -> 919,235
|
|
||||||
16,64 -> 930,978
|
|
||||||
980,25 -> 16,989
|
|
||||||
181,890 -> 952,119
|
|
||||||
877,731 -> 877,364
|
|
||||||
130,55 -> 130,111
|
|
||||||
30,298 -> 590,858
|
|
||||||
134,933 -> 134,41
|
|
||||||
711,853 -> 711,196
|
|
||||||
123,206 -> 841,924
|
|
||||||
130,585 -> 130,394
|
|
||||||
161,952 -> 531,952
|
|
||||||
455,830 -> 455,919
|
|
||||||
612,817 -> 30,817
|
|
||||||
461,474 -> 106,119
|
|
||||||
511,100 -> 581,30
|
|
||||||
263,550 -> 263,814
|
|
||||||
976,973 -> 14,11
|
|
||||||
749,876 -> 380,876
|
|
||||||
731,226 -> 731,659
|
|
||||||
630,682 -> 570,622
|
|
||||||
914,780 -> 311,780
|
|
||||||
975,274 -> 87,274
|
|
||||||
328,957 -> 724,957
|
|
||||||
357,950 -> 357,659
|
|
||||||
466,580 -> 466,726
|
|
||||||
854,425 -> 854,559
|
|
||||||
39,106 -> 39,82
|
|
||||||
675,711 -> 956,711
|
|
||||||
204,117 -> 672,585
|
|
||||||
867,101 -> 49,919
|
|
||||||
849,88 -> 784,88
|
|
||||||
394,249 -> 394,730
|
|
||||||
865,188 -> 125,928
|
|
||||||
316,918 -> 722,918
|
|
||||||
781,336 -> 781,551
|
|
||||||
821,826 -> 258,826
|
|
||||||
597,273 -> 597,653
|
|
||||||
726,266 -> 90,902
|
|
||||||
701,701 -> 941,701
|
|
||||||
105,401 -> 949,401
|
|
||||||
890,486 -> 890,205
|
|
||||||
651,409 -> 651,408
|
|
||||||
450,88 -> 51,88
|
|
||||||
29,478 -> 29,667
|
|
||||||
676,293 -> 676,77
|
|
||||||
380,773 -> 962,773
|
|
||||||
253,836 -> 429,836
|
|
||||||
833,706 -> 123,706
|
|
||||||
689,167 -> 665,143
|
|
||||||
375,540 -> 375,346
|
|
||||||
867,222 -> 746,343
|
|
||||||
99,832 -> 370,561
|
|
||||||
133,349 -> 133,815
|
|
||||||
950,981 -> 12,43
|
|
||||||
195,466 -> 644,466
|
|
||||||
84,876 -> 84,720
|
|
||||||
128,237 -> 34,331
|
|
||||||
872,947 -> 960,947
|
|
||||||
641,220 -> 641,472
|
|
||||||
489,950 -> 489,441
|
|
||||||
508,513 -> 721,300
|
|
||||||
394,137 -> 332,137
|
|
||||||
456,672 -> 625,503
|
|
||||||
65,463 -> 540,463
|
|
||||||
207,745 -> 529,423
|
|
||||||
948,888 -> 891,831
|
|
||||||
39,642 -> 165,642
|
|
||||||
20,228 -> 20,386
|
|
||||||
706,50 -> 57,699
|
|
||||||
66,736 -> 66,840
|
|
||||||
944,450 -> 915,479
|
|
||||||
697,988 -> 697,862
|
|
||||||
987,969 -> 57,39
|
|
||||||
64,813 -> 64,468
|
|
||||||
814,85 -> 469,85
|
|
||||||
667,749 -> 154,236
|
|
||||||
755,337 -> 755,50
|
|
||||||
536,185 -> 536,217
|
|
||||||
732,48 -> 529,48
|
|
||||||
33,578 -> 430,578
|
|
||||||
511,658 -> 669,658
|
|
||||||
294,352 -> 353,352
|
|
||||||
109,937 -> 820,226
|
|
||||||
465,346 -> 465,114
|
|
||||||
878,965 -> 34,121
|
|
||||||
259,933 -> 576,933
|
|
||||||
240,750 -> 240,296
|
|
||||||
567,633 -> 899,965
|
|
||||||
29,609 -> 169,469
|
|
||||||
962,532 -> 962,921
|
|
||||||
443,875 -> 395,875
|
|
||||||
831,584 -> 510,263
|
|
||||||
859,35 -> 84,810
|
|
||||||
829,285 -> 829,463
|
|
||||||
486,661 -> 883,661
|
|
||||||
371,672 -> 959,84
|
|
||||||
722,532 -> 722,241
|
|
||||||
49,216 -> 468,216
|
|
||||||
308,343 -> 308,277
|
|
||||||
183,626 -> 264,545
|
|
||||||
748,611 -> 356,611
|
|
||||||
67,85 -> 925,943
|
|
||||||
726,972 -> 726,272
|
|
||||||
841,222 -> 841,867
|
|
||||||
597,250 -> 813,250
|
|
||||||
20,631 -> 555,631
|
|
||||||
803,846 -> 589,632
|
|
||||||
276,654 -> 222,708
|
|
||||||
400,952 -> 672,952
|
|
||||||
939,173 -> 534,173
|
|
||||||
638,316 -> 638,935
|
|
||||||
578,120 -> 578,101
|
|
||||||
54,457 -> 723,457
|
|
||||||
904,713 -> 904,721
|
|
||||||
902,180 -> 99,983
|
|
||||||
590,426 -> 174,10
|
|
||||||
740,975 -> 309,975
|
|
||||||
84,242 -> 803,961
|
|
||||||
28,667 -> 362,333
|
|
||||||
73,703 -> 73,354
|
|
||||||
902,26 -> 902,365
|
|
||||||
602,455 -> 578,431
|
|
||||||
339,686 -> 339,846
|
|
||||||
764,444 -> 311,444
|
|
||||||
780,535 -> 862,453
|
|
||||||
333,127 -> 911,127
|
|
||||||
451,296 -> 451,832
|
|
||||||
849,681 -> 849,580
|
|
||||||
309,672 -> 309,913
|
|
||||||
339,411 -> 147,411
|
|
||||||
907,478 -> 974,545
|
|
||||||
444,753 -> 855,342
|
|
||||||
642,285 -> 683,244
|
|
||||||
307,633 -> 751,633
|
|
||||||
292,128 -> 767,603
|
|
||||||
969,92 -> 647,414
|
|
||||||
80,120 -> 942,982
|
|
||||||
886,810 -> 740,810
|
|
||||||
205,846 -> 168,846
|
|
||||||
878,230 -> 72,230
|
|
||||||
186,822 -> 628,822
|
|
||||||
472,66 -> 472,609
|
|
||||||
251,753 -> 129,753
|
|
||||||
575,959 -> 102,959
|
|
||||||
582,194 -> 858,194
|
|
||||||
43,986 -> 43,589
|
|
||||||
355,402 -> 751,402
|
|
||||||
982,292 -> 86,292
|
|
||||||
329,966 -> 329,379
|
|
||||||
475,291 -> 475,924
|
|
||||||
625,70 -> 625,350
|
|
||||||
358,467 -> 981,467
|
|
||||||
319,700 -> 736,283
|
|
||||||
657,247 -> 654,247
|
|
||||||
450,803 -> 450,497
|
|
||||||
812,15 -> 812,425
|
|
||||||
649,160 -> 377,160
|
|
||||||
684,491 -> 690,491
|
|
||||||
925,429 -> 772,429
|
|
||||||
138,91 -> 883,91
|
|
||||||
602,121 -> 774,293
|
|
||||||
700,531 -> 451,531
|
|
||||||
250,216 -> 800,766
|
|
||||||
550,784 -> 289,784
|
|
||||||
53,759 -> 228,759
|
|
||||||
678,310 -> 645,343
|
|
||||||
147,70 -> 171,46
|
|
||||||
130,653 -> 130,103
|
|
||||||
292,640 -> 731,640
|
|
||||||
797,762 -> 618,762
|
|
||||||
154,75 -> 964,885
|
|
||||||
222,523 -> 557,523
|
|
||||||
989,103 -> 989,964
|
|
||||||
335,61 -> 422,61
|
|
||||||
782,954 -> 160,332
|
|
||||||
82,929 -> 82,528
|
|
||||||
732,540 -> 635,637
|
|
||||||
950,362 -> 798,362
|
|
||||||
415,566 -> 916,566
|
|
||||||
588,446 -> 743,291
|
|
||||||
495,46 -> 495,435
|
|
||||||
913,561 -> 303,561
|
|
||||||
788,902 -> 788,698
|
|
||||||
81,783 -> 715,149
|
|
||||||
867,990 -> 867,558
|
|
||||||
145,919 -> 145,725
|
|
||||||
850,861 -> 727,861
|
|
||||||
535,129 -> 535,496
|
|
||||||
922,772 -> 922,917
|
|
||||||
882,559 -> 672,349
|
|
||||||
496,80 -> 496,948
|
|
||||||
915,244 -> 516,643
|
|
||||||
633,461 -> 748,461
|
|
||||||
899,341 -> 677,341
|
|
||||||
66,981 -> 878,169
|
|
||||||
68,24 -> 984,940
|
|
||||||
12,880 -> 23,869
|
|
||||||
779,514 -> 779,752
|
|
||||||
878,641 -> 949,641
|
|
||||||
264,919 -> 229,919
|
|
||||||
213,281 -> 213,196
|
|
||||||
538,149 -> 538,278
|
|
||||||
184,478 -> 364,298
|
|
||||||
301,136 -> 923,758
|
|
||||||
559,266 -> 559,986
|
|
||||||
384,37 -> 384,558
|
|
||||||
815,529 -> 800,514
|
|
||||||
33,80 -> 624,80
|
|
||||||
561,261 -> 215,607
|
|
||||||
169,944 -> 169,921
|
|
||||||
673,42 -> 164,42
|
|
||||||
820,977 -> 424,581
|
|
||||||
816,29 -> 802,29
|
|
||||||
374,924 -> 121,671
|
|
||||||
962,555 -> 426,19
|
|
||||||
982,199 -> 860,77
|
|
||||||
334,62 -> 359,62
|
|
||||||
960,785 -> 260,85
|
|
||||||
681,280 -> 860,280
|
|
||||||
184,925 -> 184,30
|
|
||||||
332,398 -> 858,924
|
|
||||||
405,270 -> 218,270
|
|
||||||
261,846 -> 29,614
|
|
||||||
591,941 -> 591,716
|
|
||||||
313,502 -> 313,637
|
|
||||||
930,259 -> 779,259
|
|
||||||
432,15 -> 566,149
|
|
||||||
51,182 -> 223,182
|
|
||||||
603,536 -> 603,281
|
|
||||||
139,703 -> 825,17
|
|
||||||
965,22 -> 55,932
|
|
||||||
389,608 -> 771,608
|
|
||||||
209,617 -> 923,617
|
|
||||||
769,672 -> 769,236
|
|
||||||
163,717 -> 638,717
|
|
||||||
801,604 -> 136,604
|
|
||||||
974,881 -> 110,17
|
|
||||||
187,226 -> 929,968
|
|
||||||
430,949 -> 473,949
|
|
||||||
899,279 -> 899,224
|
|
||||||
964,806 -> 964,876
|
|
||||||
635,190 -> 349,190
|
|
||||||
142,656 -> 142,216
|
|
||||||
740,814 -> 35,109
|
|
||||||
588,956 -> 534,956
|
|
||||||
107,968 -> 707,968
|
|
||||||
787,639 -> 787,50
|
|
||||||
964,491 -> 964,148
|
|
||||||
30,70 -> 30,323
|
|
||||||
30,905 -> 806,129
|
|
||||||
592,419 -> 91,419
|
|
||||||
73,87 -> 973,987
|
|
||||||
540,683 -> 540,139
|
|
||||||
422,107 -> 422,90
|
|
||||||
935,74 -> 935,590
|
|
||||||
728,566 -> 188,26
|
|
||||||
839,313 -> 839,620
|
|
||||||
723,898 -> 723,719
|
|
||||||
679,814 -> 679,617
|
|
||||||
203,633 -> 417,633
|
|
||||||
36,812 -> 546,302
|
|
||||||
112,316 -> 598,802
|
|
||||||
798,773 -> 989,964
|
|
||||||
914,69 -> 520,69
|
|
||||||
213,556 -> 213,19
|
|
||||||
795,516 -> 795,220
|
|
||||||
348,803 -> 664,803
|
|
||||||
910,861 -> 238,189
|
|
||||||
633,691 -> 594,691
|
|
||||||
96,166 -> 96,60
|
|
||||||
278,848 -> 854,272
|
|
||||||
64,370 -> 64,815
|
|
||||||
386,196 -> 386,222
|
|
||||||
888,330 -> 888,834
|
|
||||||
166,482 -> 37,482
|
|
||||||
594,283 -> 594,865
|
|
||||||
515,267 -> 515,448
|
|
||||||
707,279 -> 239,747
|
|
||||||
302,745 -> 302,268
|
|
||||||
210,830 -> 885,155
|
|
||||||
592,180 -> 592,324
|
|
||||||
245,154 -> 245,613
|
|
||||||
607,954 -> 545,954
|
|
||||||
854,951 -> 19,116
|
|
||||||
77,878 -> 963,878
|
|
||||||
759,585 -> 759,892
|
|
||||||
750,918 -> 750,130
|
|
||||||
62,716 -> 329,983
|
|
||||||
785,880 -> 785,590
|
|
||||||
318,794 -> 318,599
|
|
||||||
403,547 -> 719,863
|
|
||||||
742,803 -> 742,937
|
|
||||||
680,579 -> 680,425
|
|
||||||
268,404 -> 826,962
|
|
||||||
425,959 -> 710,959
|
|
||||||
406,823 -> 976,253
|
|
||||||
359,361 -> 165,361
|
|
||||||
276,861 -> 657,480
|
|
||||||
74,260 -> 743,929
|
|
||||||
194,129 -> 194,651
|
|
||||||
879,835 -> 65,21
|
|
||||||
16,977 -> 980,13
|
|
||||||
538,525 -> 624,439
|
|
||||||
985,789 -> 985,510
|
|
||||||
699,850 -> 560,711
|
|
||||||
301,48 -> 477,224
|
|
||||||
28,938 -> 905,61
|
|
||||||
844,530 -> 793,530
|
|
||||||
286,325 -> 936,975
|
|
||||||
368,122 -> 677,431
|
|
||||||
924,153 -> 924,774
|
|
||||||
783,498 -> 783,148
|
|
||||||
250,392 -> 578,392
|
|
||||||
465,345 -> 573,345
|
|
||||||
860,763 -> 860,40
|
|
||||||
373,226 -> 599,226
|
|
||||||
169,562 -> 169,292
|
|
||||||
408,123 -> 569,123
|
|
||||||
510,396 -> 733,396
|
|
||||||
199,20 -> 199,770
|
|
||||||
892,631 -> 237,631
|
|
||||||
671,863 -> 705,863
|
|
||||||
141,530 -> 141,630
|
|
||||||
467,159 -> 367,159
|
|
||||||
729,501 -> 255,975
|
|
||||||
578,871 -> 578,225
|
|
||||||
821,363 -> 821,820
|
|
||||||
@ -53,7 +53,7 @@
|
|||||||
//! Using this new interpretation of the commands, calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?
|
//! Using this new interpretation of the commands, calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use aoc_runner_derive::aoc;
|
use aoc_runner_derive::{aoc, aoc_generator};
|
||||||
|
|
||||||
#[aoc(day2, part1)]
|
#[aoc(day2, part1)]
|
||||||
fn part1(input: &str) -> Result<i32> {
|
fn part1(input: &str) -> Result<i32> {
|
||||||
|
|||||||
348
2021/src/day4.rs
348
2021/src/day4.rs
@ -1,348 +0,0 @@
|
|||||||
//! --- Day 4: Giant Squid ---
|
|
||||||
//! You're already almost 1.5km (almost a mile) below the surface of the ocean, already so deep that you can't see any sunlight. What you can see, however, is a giant squid that has attached itself to the outside of your submarine.
|
|
||||||
//!
|
|
||||||
//! Maybe it wants to play bingo?
|
|
||||||
//!
|
|
||||||
//! Bingo is played on a set of boards each consisting of a 5x5 grid of numbers. Numbers are chosen at random, and the chosen number is marked on all boards on which it appears. (Numbers may not appear on all boards.) If all numbers in any row or any column of a board are marked, that board wins. (Diagonals don't count.)
|
|
||||||
//!
|
|
||||||
//! The submarine has a bingo subsystem to help passengers (currently, you and the giant squid) pass the time. It automatically generates a random order in which to draw numbers and a random set of boards (your puzzle input). For example:
|
|
||||||
//!
|
|
||||||
//! 7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
|
|
||||||
//!
|
|
||||||
//! 22 13 17 11 0
|
|
||||||
//! 8 2 23 4 24
|
|
||||||
//! 21 9 14 16 7
|
|
||||||
//! 6 10 3 18 5
|
|
||||||
//! 1 12 20 15 19
|
|
||||||
//!
|
|
||||||
//! 3 15 0 2 22
|
|
||||||
//! 9 18 13 17 5
|
|
||||||
//! 19 8 7 25 23
|
|
||||||
//! 20 11 10 24 4
|
|
||||||
//! 14 21 16 12 6
|
|
||||||
//!
|
|
||||||
//! 14 21 17 24 4
|
|
||||||
//! 10 16 15 9 19
|
|
||||||
//! 18 8 23 26 20
|
|
||||||
//! 22 11 13 6 5
|
|
||||||
//! 2 0 12 3 7
|
|
||||||
//! After the first five numbers are drawn (7, 4, 9, 5, and 11), there are no winners, but the boards are marked as follows (shown here adjacent to each other to save space):
|
|
||||||
//!
|
|
||||||
//! 22 13 17 11 0 3 15 0 2 22 14 21 17 24 4
|
|
||||||
//! 8 2 23 4 24 9 18 13 17 5 10 16 15 9 19
|
|
||||||
//! 21 9 14 16 7 19 8 7 25 23 18 8 23 26 20
|
|
||||||
//! 6 10 3 18 5 20 11 10 24 4 22 11 13 6 5
|
|
||||||
//! 1 12 20 15 19 14 21 16 12 6 2 0 12 3 7
|
|
||||||
//! After the next six numbers are drawn (17, 23, 2, 0, 14, and 21), there are still no winners:
|
|
||||||
//!
|
|
||||||
//! 22 13 17 11 0 3 15 0 2 22 14 21 17 24 4
|
|
||||||
//! 8 2 23 4 24 9 18 13 17 5 10 16 15 9 19
|
|
||||||
//! 21 9 14 16 7 19 8 7 25 23 18 8 23 26 20
|
|
||||||
//! 6 10 3 18 5 20 11 10 24 4 22 11 13 6 5
|
|
||||||
//! 1 12 20 15 19 14 21 16 12 6 2 0 12 3 7
|
|
||||||
//! Finally, 24 is drawn:
|
|
||||||
//!
|
|
||||||
//! 22 13 17 11 0 3 15 0 2 22 14 21 17 24 4
|
|
||||||
//! 8 2 23 4 24 9 18 13 17 5 10 16 15 9 19
|
|
||||||
//! 21 9 14 16 7 19 8 7 25 23 18 8 23 26 20
|
|
||||||
//! 6 10 3 18 5 20 11 10 24 4 22 11 13 6 5
|
|
||||||
//! 1 12 20 15 19 14 21 16 12 6 2 0 12 3 7
|
|
||||||
//! At this point, the third board wins because it has at least one complete row or column of marked numbers (in this case, the entire top row is marked: 14 21 17 24 4).
|
|
||||||
//!
|
|
||||||
//! The score of the winning board can now be calculated. Start by finding the sum of all unmarked numbers on that board; in this case, the sum is 188. Then, multiply that sum by the number that was just called when the board won, 24, to get the final score, 188 * 24 = 4512.
|
|
||||||
//!
|
|
||||||
//! To guarantee victory against the giant squid, figure out which board will win first. What will your final score be if you choose that board?
|
|
||||||
//!
|
|
||||||
//! --- Part Two ---
|
|
||||||
//! On the other hand, it might be wise to try a different strategy: let the giant squid win.
|
|
||||||
//!
|
|
||||||
//! You aren't sure how many bingo boards a giant squid could play at once, so rather than waste time counting its arms, the safe thing to do is to figure out which board will win last and choose that one. That way, no matter which boards it picks, it will win for sure.
|
|
||||||
//!
|
|
||||||
//! In the above example, the second board is the last to win, which happens after 13 is eventually called and its middle column is completely marked. If you were to keep playing until this point, the second board would have a sum of unmarked numbers equal to 148 for a final score of 148 * 13 = 1924.
|
|
||||||
//!
|
|
||||||
//! Figure out which board will win last. Once it wins, what would its final score be?
|
|
||||||
|
|
||||||
use std::{
|
|
||||||
collections::{HashMap, HashSet},
|
|
||||||
fmt::{Debug, Error, Formatter},
|
|
||||||
num::ParseIntError,
|
|
||||||
str::FromStr,
|
|
||||||
};
|
|
||||||
|
|
||||||
use ansi_term::Color::Green;
|
|
||||||
use anyhow::Result;
|
|
||||||
use aoc_runner_derive::aoc;
|
|
||||||
use thiserror::Error;
|
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
|
||||||
struct Game {
|
|
||||||
numbers: Vec<u64>,
|
|
||||||
boards: Vec<Board>,
|
|
||||||
skip_boards: HashSet<usize>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
|
||||||
enum GameError {
|
|
||||||
#[error("couldn't parse number {0}")]
|
|
||||||
ParseIntError(#[from] ParseIntError),
|
|
||||||
#[error("couldn't parse board {0}")]
|
|
||||||
BoardError(#[from] BoardError),
|
|
||||||
#[error("unknown")]
|
|
||||||
Unknown,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Game {
|
|
||||||
// If return not None, it contains a winning board
|
|
||||||
fn apply_number(&mut self, number: u64) -> Option<&Board> {
|
|
||||||
for b in &mut self.boards {
|
|
||||||
b.mark(number);
|
|
||||||
if b.is_bingo() {
|
|
||||||
return Some(b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None
|
|
||||||
}
|
|
||||||
// If return not None, it contains a winning board. This will remove winning boards until only
|
|
||||||
// one remains.
|
|
||||||
fn apply_number_part2(&mut self, number: u64) -> Option<&Board> {
|
|
||||||
let num_boards = self.boards.len();
|
|
||||||
for (idx, b) in self.boards.iter_mut().enumerate() {
|
|
||||||
if self.skip_boards.contains(&idx) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
b.mark(number);
|
|
||||||
if b.is_bingo() {
|
|
||||||
self.skip_boards.insert(idx);
|
|
||||||
if self.skip_boards.len() == num_boards {
|
|
||||||
return Some(b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl FromStr for Game {
|
|
||||||
type Err = GameError;
|
|
||||||
|
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
|
||||||
let mut it = s.split("\n\n");
|
|
||||||
let numbers = it
|
|
||||||
.next()
|
|
||||||
.unwrap()
|
|
||||||
.split(",")
|
|
||||||
.map(|s| s.parse())
|
|
||||||
.collect::<Result<_, ParseIntError>>()?;
|
|
||||||
let boards: Vec<_> = it.map(|s| s.parse()).collect::<Result<_, BoardError>>()?;
|
|
||||||
Ok(Game {
|
|
||||||
numbers,
|
|
||||||
boards,
|
|
||||||
skip_boards: Default::default(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Default)]
|
|
||||||
struct Board {
|
|
||||||
numbers: HashMap<(usize, usize), u64>,
|
|
||||||
marked: HashSet<(usize, usize)>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
|
||||||
enum BoardError {
|
|
||||||
#[error("couldn't parse number {0}")]
|
|
||||||
ParseIntError(#[from] ParseIntError),
|
|
||||||
#[error("unknown")]
|
|
||||||
Unknown,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Board {
|
|
||||||
fn is_bingo(&self) -> bool {
|
|
||||||
for y in 0..5 {
|
|
||||||
if (0..5).all(|x| self.marked.contains(&(x, y))) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for x in 0..5 {
|
|
||||||
if (0..5).all(|y| self.marked.contains(&(x, y))) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
fn sum_uncovered(&self) -> u64 {
|
|
||||||
self.numbers
|
|
||||||
.iter()
|
|
||||||
.map(|((x, y), v)| {
|
|
||||||
if !self.marked.contains(&(*x, *y)) {
|
|
||||||
*v
|
|
||||||
} else {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.sum()
|
|
||||||
}
|
|
||||||
// Returns true if board has num.
|
|
||||||
fn mark(&mut self, num: u64) -> bool {
|
|
||||||
for ((x, y), v) in self.numbers.iter() {
|
|
||||||
if *v == num {
|
|
||||||
self.marked.insert((*x, *y));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Debug for Board {
|
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> {
|
|
||||||
writeln!(f)?;
|
|
||||||
for y in 0..5 {
|
|
||||||
for x in 0..5 {
|
|
||||||
if self.marked.contains(&(x, y)) {
|
|
||||||
let v = format!("{:3}", self.numbers[&(x, y)]);
|
|
||||||
write!(f, "{}", Green.bold().paint(v))?;
|
|
||||||
} else {
|
|
||||||
write!(f, "{:3}", self.numbers[&(x, y)])?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
writeln!(f, "")?;
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl FromStr for Board {
|
|
||||||
type Err = BoardError;
|
|
||||||
|
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
|
||||||
let numbers: Vec<Vec<_>> = s
|
|
||||||
.split("\n")
|
|
||||||
.map(|l| {
|
|
||||||
l.split(" ")
|
|
||||||
// Remove the double space that happens before single digit cells.
|
|
||||||
.filter(|c| *c != "")
|
|
||||||
.map(|c| c.parse())
|
|
||||||
.collect::<Result<_, ParseIntError>>()
|
|
||||||
})
|
|
||||||
.collect::<Result<_, ParseIntError>>()?;
|
|
||||||
let numbers: HashMap<_, _> = numbers
|
|
||||||
.iter()
|
|
||||||
.enumerate()
|
|
||||||
.flat_map(|(y, row)| row.iter().enumerate().map(move |(x, c)| ((x, y), *c)))
|
|
||||||
.collect();
|
|
||||||
Ok(Board {
|
|
||||||
numbers,
|
|
||||||
marked: Default::default(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[aoc(day4, part1)]
|
|
||||||
fn part1(input: &str) -> Result<u64> {
|
|
||||||
let mut g: Game = input.parse()?;
|
|
||||||
let numbers = g.numbers.clone();
|
|
||||||
for n in numbers {
|
|
||||||
if let Some(b) = g.apply_number(n) {
|
|
||||||
println!("winning board {:?}", b);
|
|
||||||
return Ok(n as u64 * b.sum_uncovered());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unreachable!("We should have had a winner by now");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[aoc(day4, part2)]
|
|
||||||
fn part2(input: &str) -> Result<u64> {
|
|
||||||
let mut g: Game = input.parse()?;
|
|
||||||
let numbers = g.numbers.clone();
|
|
||||||
for n in numbers {
|
|
||||||
if let Some(b) = g.apply_number_part2(n) {
|
|
||||||
println!("winning board {:?}", b);
|
|
||||||
return Ok(n as u64 * b.sum_uncovered());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unreachable!("We should have had a winner by now");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_board() -> Result<()> {
|
|
||||||
let input = r#"
|
|
||||||
14 21 17 24 4
|
|
||||||
10 16 15 9 19
|
|
||||||
18 8 23 26 20
|
|
||||||
22 11 13 6 5
|
|
||||||
2 0 12 3 7
|
|
||||||
"#
|
|
||||||
.trim();
|
|
||||||
let mut b = Board::from_str(input)?;
|
|
||||||
assert!(!b.is_bingo());
|
|
||||||
assert!(!b.mark(100));
|
|
||||||
|
|
||||||
for num in &[7, 4, 9, 5, 11, 17, 23, 2, 0, 14, 21, 24] {
|
|
||||||
assert!(b.mark(*num));
|
|
||||||
}
|
|
||||||
assert!(b.is_bingo());
|
|
||||||
assert_eq!(b.sum_uncovered(), 188);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_part1() -> Result<()> {
|
|
||||||
let input = r#"
|
|
||||||
7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
|
|
||||||
|
|
||||||
22 13 17 11 0
|
|
||||||
8 2 23 4 24
|
|
||||||
21 9 14 16 7
|
|
||||||
6 10 3 18 5
|
|
||||||
1 12 20 15 19
|
|
||||||
|
|
||||||
3 15 0 2 22
|
|
||||||
9 18 13 17 5
|
|
||||||
19 8 7 25 23
|
|
||||||
20 11 10 24 4
|
|
||||||
14 21 16 12 6
|
|
||||||
|
|
||||||
14 21 17 24 4
|
|
||||||
10 16 15 9 19
|
|
||||||
18 8 23 26 20
|
|
||||||
22 11 13 6 5
|
|
||||||
2 0 12 3 7
|
|
||||||
"#
|
|
||||||
.trim();
|
|
||||||
assert_eq!(part1(input)?, 4512);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_part2() -> Result<()> {
|
|
||||||
let input = r#"
|
|
||||||
7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
|
|
||||||
|
|
||||||
22 13 17 11 0
|
|
||||||
8 2 23 4 24
|
|
||||||
21 9 14 16 7
|
|
||||||
6 10 3 18 5
|
|
||||||
1 12 20 15 19
|
|
||||||
|
|
||||||
3 15 0 2 22
|
|
||||||
9 18 13 17 5
|
|
||||||
19 8 7 25 23
|
|
||||||
20 11 10 24 4
|
|
||||||
14 21 16 12 6
|
|
||||||
|
|
||||||
14 21 17 24 4
|
|
||||||
10 16 15 9 19
|
|
||||||
18 8 23 26 20
|
|
||||||
22 11 13 6 5
|
|
||||||
2 0 12 3 7
|
|
||||||
"#
|
|
||||||
.trim();
|
|
||||||
assert_eq!(part2(input)?, 1924);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
309
2021/src/day5.rs
309
2021/src/day5.rs
@ -1,309 +0,0 @@
|
|||||||
//!
|
|
||||||
//! --- Day 5: Hydrothermal Venture ---
|
|
||||||
//! You come across a field of hydrothermal vents on the ocean floor! These vents constantly produce large, opaque clouds, so it would be best to avoid them if possible.
|
|
||||||
//!
|
|
||||||
//! They tend to form in lines; the submarine helpfully produces a list of nearby lines of vents (your puzzle input) for you to review. For example:
|
|
||||||
//!
|
|
||||||
//! 0,9 -> 5,9
|
|
||||||
//! 8,0 -> 0,8
|
|
||||||
//! 9,4 -> 3,4
|
|
||||||
//! 2,2 -> 2,1
|
|
||||||
//! 7,0 -> 7,4
|
|
||||||
//! 6,4 -> 2,0
|
|
||||||
//! 0,9 -> 2,9
|
|
||||||
//! 3,4 -> 1,4
|
|
||||||
//! 0,0 -> 8,8
|
|
||||||
//! 5,5 -> 8,2
|
|
||||||
//! Each line of vents is given as a line segment in the format x1,y1 -> x2,y2 where x1,y1 are the coordinates of one end the line segment and x2,y2 are the coordinates of the other end. These line segments include the points at both ends. In other words:
|
|
||||||
//!
|
|
||||||
//! An entry like 1,1 -> 1,3 covers points 1,1, 1,2, and 1,3.
|
|
||||||
//! An entry like 9,7 -> 7,7 covers points 9,7, 8,7, and 7,7.
|
|
||||||
//! For now, only consider horizontal and vertical lines: lines where either x1 = x2 or y1 = y2.
|
|
||||||
//!
|
|
||||||
//! So, the horizontal and vertical lines from the above list would produce the following diagram:
|
|
||||||
//!
|
|
||||||
//! .......1..
|
|
||||||
//! ..1....1..
|
|
||||||
//! ..1....1..
|
|
||||||
//! .......1..
|
|
||||||
//! .112111211
|
|
||||||
//! ..........
|
|
||||||
//! ..........
|
|
||||||
//! ..........
|
|
||||||
//! ..........
|
|
||||||
//! 222111....
|
|
||||||
//! In this diagram, the top left corner is 0,0 and the bottom right corner is 9,9. Each position is shown as the number of lines which cover that point or . if no line covers that point. The top-left pair of 1s, for example, comes from 2,2 -> 2,1; the very bottom row is formed by the overlapping lines 0,9 -> 5,9 and 0,9 -> 2,9.
|
|
||||||
//!
|
|
||||||
//! To avoid the most dangerous areas, you need to determine the number of points where at least two lines overlap. In the above example, this is anywhere in the diagram with a 2 or larger - a total of 5 points.
|
|
||||||
//!
|
|
||||||
//! Consider only horizontal and vertical lines. At how many points do at least two lines overlap?
|
|
||||||
//!
|
|
||||||
//! --- Part Two ---
|
|
||||||
//! Unfortunately, considering only horizontal and vertical lines doesn't give you the full picture; you need to also consider diagonal lines.
|
|
||||||
//!
|
|
||||||
//! Because of the limits of the hydrothermal vent mapping system, the lines in your list will only ever be horizontal, vertical, or a diagonal line at exactly 45 degrees. In other words:
|
|
||||||
//!
|
|
||||||
//! An entry like 1,1 -> 3,3 covers points 1,1, 2,2, and 3,3.
|
|
||||||
//! An entry like 9,7 -> 7,9 covers points 9,7, 8,8, and 7,9.
|
|
||||||
//! Considering all lines from the above example would now produce the following diagram:
|
|
||||||
//!
|
|
||||||
//! 1.1....11.
|
|
||||||
//! .111...2..
|
|
||||||
//! ..2.1.111.
|
|
||||||
//! ...1.2.2..
|
|
||||||
//! .112313211
|
|
||||||
//! ...1.2....
|
|
||||||
//! ..1...1...
|
|
||||||
//! .1.....1..
|
|
||||||
//! 1.......1.
|
|
||||||
//! 222111....
|
|
||||||
//! You still need to determine the number of points where at least two lines overlap. In the above example, this is still anywhere in the diagram with a 2 or larger - now a total of 12 points.
|
|
||||||
//!
|
|
||||||
//! Consider all of the lines. At how many points do at least two lines overlap?
|
|
||||||
|
|
||||||
use std::{
|
|
||||||
fmt::{Debug, Error, Formatter},
|
|
||||||
num::ParseIntError,
|
|
||||||
ops::{Index, IndexMut},
|
|
||||||
str::FromStr,
|
|
||||||
};
|
|
||||||
|
|
||||||
use anyhow::Result;
|
|
||||||
use aoc_runner_derive::{aoc, aoc_generator};
|
|
||||||
use thiserror::Error;
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
struct Point {
|
|
||||||
x: i32,
|
|
||||||
y: i32,
|
|
||||||
}
|
|
||||||
|
|
||||||
struct Line {
|
|
||||||
p0: Point,
|
|
||||||
p1: Point,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
|
||||||
enum LineError {
|
|
||||||
#[error("couldn't parse number {0}")]
|
|
||||||
ParseIntError(#[from] ParseIntError),
|
|
||||||
#[error("input truncated")]
|
|
||||||
PrematureEOL,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Debug for Line {
|
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> {
|
|
||||||
writeln!(
|
|
||||||
f,
|
|
||||||
"{},{} -> {},{}",
|
|
||||||
self.p0.x, self.p0.y, self.p1.x, self.p1.y,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl FromStr for Line {
|
|
||||||
type Err = LineError;
|
|
||||||
|
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
|
||||||
let mut it = s.split(" ");
|
|
||||||
let parse_point = |it: &mut dyn Iterator<Item = &str>| -> Result<Point, LineError> {
|
|
||||||
let p = it.next().ok_or(LineError::PrematureEOL)?;
|
|
||||||
let nums: Vec<_> = p
|
|
||||||
.split(",")
|
|
||||||
.map(|n| n.parse())
|
|
||||||
.collect::<Result<_, ParseIntError>>()?;
|
|
||||||
Ok(Point {
|
|
||||||
x: nums[0],
|
|
||||||
y: nums[1],
|
|
||||||
})
|
|
||||||
};
|
|
||||||
let p0 = parse_point(&mut it)?;
|
|
||||||
let _ = it.next().ok_or(LineError::PrematureEOL)?;
|
|
||||||
let p1 = parse_point(&mut it)?;
|
|
||||||
Ok(Line { p0, p1 })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct Image {
|
|
||||||
width: usize,
|
|
||||||
height: usize,
|
|
||||||
pixels: Vec<u32>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Image {
|
|
||||||
fn new(width: usize, height: usize) -> Image {
|
|
||||||
Image {
|
|
||||||
width,
|
|
||||||
height,
|
|
||||||
pixels: vec![0; width * height],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fn answer(&self) -> u32 {
|
|
||||||
self.pixels.iter().filter(|&v| *v > 1).count() as u32
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Index<(usize, usize)> for Image {
|
|
||||||
type Output = u32;
|
|
||||||
fn index(&self, (x, y): (usize, usize)) -> &Self::Output {
|
|
||||||
&self.pixels[x + y * self.width]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl IndexMut<(usize, usize)> for Image {
|
|
||||||
fn index_mut(&mut self, (x, y): (usize, usize)) -> &mut Self::Output {
|
|
||||||
&mut self.pixels[x + y * self.width]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Debug for Image {
|
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> {
|
|
||||||
writeln!(f, "({}, {})", self.width, self.height)?;
|
|
||||||
for y in 0..self.height {
|
|
||||||
for x in 0..self.width {
|
|
||||||
let v = self[(x, y)];
|
|
||||||
if v == 0 {
|
|
||||||
write!(f, ".")?;
|
|
||||||
} else {
|
|
||||||
write!(f, "{}", v)?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
writeln!(f)?;
|
|
||||||
}
|
|
||||||
writeln!(f)?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[aoc_generator(day5)]
|
|
||||||
fn parse(input: &str) -> Result<Vec<Line>> {
|
|
||||||
Ok(input
|
|
||||||
.split("\n")
|
|
||||||
.map(|l| l.parse())
|
|
||||||
.collect::<Result<_, LineError>>()?)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn draw(im: &mut Image, l: &Line) {
|
|
||||||
let dx = l.p1.x - l.p0.x;
|
|
||||||
let dy = l.p1.y - l.p0.y;
|
|
||||||
|
|
||||||
if dx == 0 {
|
|
||||||
let x = l.p0.x as usize;
|
|
||||||
let sy = l.p0.y;
|
|
||||||
let ey = l.p1.y;
|
|
||||||
let (sy, ey) = if sy > ey { (ey, sy) } else { (sy, ey) };
|
|
||||||
for y in sy..=ey {
|
|
||||||
im[(x, y as usize)] += 1;
|
|
||||||
}
|
|
||||||
} else if dy == 0 {
|
|
||||||
let y = l.p0.y as usize;
|
|
||||||
let sx = l.p0.x;
|
|
||||||
let ex = l.p1.x;
|
|
||||||
let (sx, ex) = if sx > ex { (ex, sx) } else { (sx, ex) };
|
|
||||||
for x in sx..=ex {
|
|
||||||
im[(x as usize, y)] += 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// We only support 45 degree angles.
|
|
||||||
assert_eq!(dx.abs(), dy.abs());
|
|
||||||
let dx = dx / dx.abs();
|
|
||||||
let dy = dy / dy.abs();
|
|
||||||
|
|
||||||
let mut x = l.p0.x;
|
|
||||||
let mut y = l.p0.y;
|
|
||||||
while x != l.p1.x && y != l.p1.y {
|
|
||||||
im[(x as usize, y as usize)] += 1;
|
|
||||||
x += dx;
|
|
||||||
y += dy;
|
|
||||||
}
|
|
||||||
im[(x as usize, y as usize)] += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[aoc(day5, part1)]
|
|
||||||
fn part1(lines: &[Line]) -> Result<u32> {
|
|
||||||
let width = lines
|
|
||||||
.iter()
|
|
||||||
.map(|l| l.p0.x.max(l.p1.x) as usize)
|
|
||||||
.max()
|
|
||||||
.expect("couldn't find max width")
|
|
||||||
+ 1;
|
|
||||||
let height = lines
|
|
||||||
.iter()
|
|
||||||
.map(|l| l.p0.y.max(l.p1.y) as usize)
|
|
||||||
.max()
|
|
||||||
.expect("couldn't find max height")
|
|
||||||
+ 1;
|
|
||||||
let mut im = Image::new(width, height);
|
|
||||||
for l in lines
|
|
||||||
.iter()
|
|
||||||
.filter(|l| l.p0.x == l.p1.x || l.p0.y == l.p1.y)
|
|
||||||
{
|
|
||||||
draw(&mut im, l);
|
|
||||||
}
|
|
||||||
Ok(im.answer())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[aoc(day5, part2)]
|
|
||||||
fn part2(lines: &[Line]) -> Result<u32> {
|
|
||||||
let width = lines
|
|
||||||
.iter()
|
|
||||||
.map(|l| l.p0.x.max(l.p1.x) as usize)
|
|
||||||
.max()
|
|
||||||
.expect("couldn't find max width")
|
|
||||||
+ 1;
|
|
||||||
let height = lines
|
|
||||||
.iter()
|
|
||||||
.map(|l| l.p0.y.max(l.p1.y) as usize)
|
|
||||||
.max()
|
|
||||||
.expect("couldn't find max height")
|
|
||||||
+ 1;
|
|
||||||
let mut im = Image::new(width, height);
|
|
||||||
for l in lines {
|
|
||||||
draw(&mut im, l);
|
|
||||||
}
|
|
||||||
Ok(im.answer())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_part1() -> Result<()> {
|
|
||||||
let input = r#"
|
|
||||||
0,9 -> 5,9
|
|
||||||
8,0 -> 0,8
|
|
||||||
9,4 -> 3,4
|
|
||||||
2,2 -> 2,1
|
|
||||||
7,0 -> 7,4
|
|
||||||
6,4 -> 2,0
|
|
||||||
0,9 -> 2,9
|
|
||||||
3,4 -> 1,4
|
|
||||||
0,0 -> 8,8
|
|
||||||
5,5 -> 8,2
|
|
||||||
"#
|
|
||||||
.trim();
|
|
||||||
assert_eq!(part1(&parse(input)?)?, 5);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_part2() -> Result<()> {
|
|
||||||
let input = r#"
|
|
||||||
0,9 -> 5,9
|
|
||||||
8,0 -> 0,8
|
|
||||||
9,4 -> 3,4
|
|
||||||
2,2 -> 2,1
|
|
||||||
7,0 -> 7,4
|
|
||||||
6,4 -> 2,0
|
|
||||||
0,9 -> 2,9
|
|
||||||
3,4 -> 1,4
|
|
||||||
0,0 -> 8,8
|
|
||||||
5,5 -> 8,2
|
|
||||||
"#
|
|
||||||
.trim();
|
|
||||||
assert_eq!(part2(&parse(input)?)?, 12);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,8 +1,6 @@
|
|||||||
pub mod day1;
|
pub mod day1;
|
||||||
pub mod day2;
|
pub mod day2;
|
||||||
pub mod day3;
|
pub mod day3;
|
||||||
pub mod day4;
|
|
||||||
pub mod day5;
|
|
||||||
|
|
||||||
use aoc_runner_derive::aoc_lib;
|
use aoc_runner_derive::aoc_lib;
|
||||||
|
|
||||||
|
|||||||
@ -21,27 +21,22 @@ fn part2(depths: &[u32]) -> Result<u32> {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#[cfg(test)]
|
#[test]
|
||||||
mod tests {
|
fn test_part1() -> Result<()> {
|
||||||
use super::*;
|
let input = r#"
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_part1() -> Result<()> {
|
|
||||||
let input = r#"
|
|
||||||
"#
|
"#
|
||||||
.trim();
|
.trim();
|
||||||
assert_eq!(part1(&parse(input)?)?, TODO);
|
assert_eq!(part1(&parse(input)?)?, TODO);
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
#[test]
|
|
||||||
fn test_part2()->Result<()> {
|
|
||||||
let input = r#"
|
|
||||||
"#
|
|
||||||
.trim();
|
|
||||||
assert_eq!(part2(&parse(input)?)?, TODO);
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
#[test]
|
||||||
|
fn test_part2()->Result<()> {
|
||||||
|
let input = r#"
|
||||||
|
"#
|
||||||
|
.trim();
|
||||||
|
assert_eq!(part2(&parse(input)?)?, TODO);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
imports_granularity = "Crate"
|
|
||||||
Loading…
x
Reference in New Issue
Block a user