2020: day18: part 1
This commit is contained in:
parent
44c1178c72
commit
426ea00636
80
Cargo.lock
generated
80
Cargo.lock
generated
|
@ -69,6 +69,7 @@ dependencies = [
|
|||
"anyhow",
|
||||
"aoc",
|
||||
"itertools",
|
||||
"nom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -79,6 +80,12 @@ dependencies = [
|
|||
"criterion",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
|
||||
|
||||
[[package]]
|
||||
name = "atty"
|
||||
version = "0.2.14"
|
||||
|
@ -102,6 +109,18 @@ version = "1.2.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||
|
||||
[[package]]
|
||||
name = "bitvec"
|
||||
version = "0.19.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a7ba35e9565969edb811639dbebfe34edc0368e472c5018474c8eb2543397f81"
|
||||
dependencies = [
|
||||
"funty",
|
||||
"radium",
|
||||
"tap",
|
||||
"wyz",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "block-buffer"
|
||||
version = "0.7.3"
|
||||
|
@ -310,6 +329,12 @@ version = "1.6.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
|
||||
|
||||
[[package]]
|
||||
name = "funty"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ba62103ce691c2fd80fbae2213dfdda9ce60804973ac6b6e97de818ea7f52c8"
|
||||
|
||||
[[package]]
|
||||
name = "generic-array"
|
||||
version = "0.12.3"
|
||||
|
@ -364,6 +389,19 @@ version = "1.4.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||
|
||||
[[package]]
|
||||
name = "lexical-core"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "db65c6da02e61f55dae90a0ae427b2a5f6b3e8db09f58d10efab23af92592616"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"bitflags",
|
||||
"cfg-if 0.1.10",
|
||||
"ryu",
|
||||
"static_assertions",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.81"
|
||||
|
@ -405,6 +443,18 @@ dependencies = [
|
|||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "6.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "88034cfd6b4a0d54dd14f4a507eceee36c0b70e5a02236c4e4df571102be17f0"
|
||||
dependencies = [
|
||||
"bitvec",
|
||||
"lexical-core",
|
||||
"memchr",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.14"
|
||||
|
@ -466,6 +516,12 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "radium"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8"
|
||||
|
||||
[[package]]
|
||||
name = "rayon"
|
||||
version = "1.5.0"
|
||||
|
@ -598,6 +654,12 @@ dependencies = [
|
|||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "static_assertions"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.54"
|
||||
|
@ -609,6 +671,12 @@ dependencies = [
|
|||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tap"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "36474e732d1affd3a6ed582781b3683df3d0563714c59c39591e8ff707cf078e"
|
||||
|
||||
[[package]]
|
||||
name = "textwrap"
|
||||
version = "0.11.0"
|
||||
|
@ -646,6 +714,12 @@ version = "0.2.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
|
||||
|
||||
[[package]]
|
||||
name = "walkdir"
|
||||
version = "2.3.1"
|
||||
|
@ -751,3 +825,9 @@ name = "winapi-x86_64-pc-windows-gnu"
|
|||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
||||
[[package]]
|
||||
name = "wyz"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214"
|
||||
|
|
|
@ -10,6 +10,7 @@ edition = "2018"
|
|||
aoc = { path = "../aoc" }
|
||||
anyhow = "1.0"
|
||||
itertools = "0.9"
|
||||
nom = "6.0"
|
||||
|
||||
[lib]
|
||||
path = "src/lib.rs"
|
||||
|
|
373
aoc2020/input/day18.txt
Normal file
373
aoc2020/input/day18.txt
Normal file
|
@ -0,0 +1,373 @@
|
|||
5 + (6 + 3 + (4 + 7 * 3 + 6 + 4 + 2) * 9) * 7 + 7
|
||||
5 * 8 + 3 * ((5 + 9 * 9) * (3 * 5 + 7 * 2 * 3) + 3 * 6) + 8
|
||||
5 + 5 * (6 + 7) * 5 + 4 * (3 * 3 * 8 + 2)
|
||||
(6 + 2 + 9 + 9) * 6 + (2 + (5 * 3 + 4 * 5 * 8 + 5) + 6 + (5 + 9 * 8 + 2 + 2))
|
||||
3 + (5 * 4 * 6 + 5 * (9 + 7 * 9)) * 5 + ((2 + 8 * 2) * 6)
|
||||
3 * (9 + 9) * 4
|
||||
5 * 6 + ((2 + 8 * 5) + (5 * 7 + 4 * 9 + 2 + 3) + 5 * 4 * 5) * 4 * 4
|
||||
8 + 5 + 5 * ((9 + 9 * 2 * 3 + 3 * 9) + (7 * 4 + 2))
|
||||
((2 * 5 * 5 + 6) * 6) + 3 * 9 * (8 * 3 + 4) * 7 * (3 + 9 + 8 * (8 * 8 * 5) + 8 * 3)
|
||||
9 + (6 + (4 + 2 * 3 + 4) * 7 + 6 * 7) * 8 + 6
|
||||
6 * 9 * (9 * 9) + 5 + 8 + 9
|
||||
3 + 4 * 5 * 7 * ((3 + 9 * 9) + 2 + (5 + 3 + 5 + 2 + 8 + 4) * 6 * 6 + (2 * 5 * 8 * 6)) * (7 + 3 * 7 * 2 * 5 + 6)
|
||||
9 + 6 + 5 * 2 * (2 + 4 + 9 * 4)
|
||||
(2 * 4 * (9 + 8 + 8) + 6 * 2 + 8) + 4
|
||||
(5 + 4 * (9 + 2 * 2 + 6 * 9 * 5) * 5 * 7) + (6 * 8 + 7)
|
||||
3 + 8 * 4 + 2 + (7 * (7 * 5)) + 2
|
||||
3 + 4 * ((2 + 5 * 6) + 2 + 5 * 4 * (9 * 8 * 6 + 9) * (9 * 5 * 4 + 9 + 2)) + 6
|
||||
(6 * 4 + 2) * 7 * 6 * 5 * ((4 + 5 * 8) + 6 + 7) * 7
|
||||
(3 * 5 * 4 * 5 + 9) + 6 + 6 * (6 + 2 * 5 + 7 * 4)
|
||||
5 * ((5 + 3 + 6 + 9 + 7) + 5) * 6 * (9 + 9 * 3 + 4 + 3) * (5 * (3 * 5 * 2))
|
||||
9 * (8 * 9 * 2 + 2) * 7 * 9 * 7 + 4
|
||||
3 * 2 * 8 * 9 + 6 * ((5 + 8 + 2 + 2) * 7)
|
||||
7 * 7 * (5 * 8 + 9 * 2 + 8) + 3 + 2 + 5
|
||||
9 * 2 + (6 + 8 + (2 + 3 + 7 + 4 + 5 * 6) + 5 + 8)
|
||||
8 + (6 * 2 + 4 + 7 * 9) + 5 * ((7 * 6 * 6) * (9 + 8 * 2 * 8) + 9 + 8 * 5) * 2
|
||||
(5 + 5 + 6 + 6 * (4 + 9 * 3 + 8 + 5) * 2) + (6 + 6) * (7 * 2 * 8 + 2) + 8 * 3 + 4
|
||||
7 + 9 + ((9 * 5 + 6 * 6 * 6) * (6 + 7 + 8 * 7 * 4 + 6) + 8 + 4 + 9) + (9 + 3 * 4)
|
||||
5 + (9 + 4 * (7 + 4 * 5 + 5) + (6 + 8 * 7) + (8 + 2)) + 3 + 8 + (7 * 7 + 6 * 9 + 5)
|
||||
(3 * 5 * 8 * 9) + 9 * 3 * (5 + (4 * 7 * 7 + 5 * 7) * 8 * 5 + 4 + (3 * 5 + 4)) + 2 * 6
|
||||
((6 * 7 + 6) + 5 * 8 * (9 * 2 * 4)) * (4 + 6 + 3 * 9 + 7)
|
||||
3 + 5 * 5 + 8 + 9
|
||||
5 + (7 * (2 * 4 + 5 * 2 + 7 + 6) + 2 * 7) + 3 + 9 + (2 * 4 * 4)
|
||||
(5 + 6 * (6 + 9 * 2)) * 4 + 3 + 7 * 3
|
||||
9 * 5 * ((5 * 9 + 5 * 4) * 3 + 5 + 4 + 2) * 3 + 9
|
||||
7 + 7 * 9 * (7 * 3) * 5 * 8
|
||||
4 + (5 * 2 + 9 + 6) * 2 * 3 * 3
|
||||
9 * 9 * 5 * ((9 * 5 * 9 + 3 * 7 + 4) * 9 * 5) + 5 + 3
|
||||
(7 + 8 + (2 + 9 + 6 * 6 + 9 + 6)) + 6 * 7 + 9 + 9
|
||||
8 * (3 * 8 + 5 * 4 + 5 + (5 + 5 + 9)) + 9 * 5 * 4
|
||||
(6 + 5) + 9 * 2 * 8
|
||||
(8 * 5) + 6 * 6 * 6 * ((3 + 7 + 3) * 9)
|
||||
4 * (3 * 2 * 5 + (6 * 2) * (8 * 8 * 4 * 8 + 3 + 3) * 6) + 2 + 3 + 9 * 8
|
||||
((8 * 6 + 4 + 5 + 6 * 3) + (8 * 8 * 7) * 2 * 6 * 3 * 7) * (4 + 7 * 4) + 4 + 2 + 3 * 9
|
||||
7 * 4 + 5 + 3 + (4 * 3 + (6 * 8 * 5 * 5 + 4) + 9 * 3 * 8) * 9
|
||||
2 + (3 + 3 + 6 + 2) * 5
|
||||
9 + 8 + 9 + 4 * ((2 * 2 * 4 * 9 * 4) * (3 + 5 * 7 + 9) + (7 + 9 * 2 * 7 * 3) + 7)
|
||||
8 + 3 + 2 * (2 * (7 * 5))
|
||||
(8 + 5 * 8) * 8 + 4 * (3 * (5 * 3)) * 7
|
||||
(3 * 9) * 8 + (3 * (9 + 3 * 2 * 7 * 9) + 8 * 9) * 4 * 7
|
||||
8 * 7 * (3 + 4 + (5 + 7 * 4 + 2 + 7) * 7 + 8 + 9) + ((8 + 3) + 3) * (9 * 2 + (7 * 6 + 3 + 3 * 2) + (8 * 6 + 8 * 8 * 4 * 9)) * 4
|
||||
5 * (3 + 5) + 5 * 7 * 4
|
||||
(5 * 5) * (5 * 4 + 8 + 6 + (2 + 6 + 2 + 6 * 4 * 8) * 6) * 7 + 3
|
||||
(6 * 9 + 8 + (9 + 8 + 2 * 4 * 2 + 3) * (8 + 6 * 9 + 9)) + 9 * 5
|
||||
(3 + (2 + 6 * 5 + 9 * 4) * (2 * 4) + 2 * 3) + 4 + 6 + (7 + 2) * 6 + 4
|
||||
5 + (4 * 2 + 7 * 6 + 6 + 3) + (7 + 7 * (8 * 3 + 8 * 4 + 4 * 2) + 7 * (8 + 2 + 9 * 6 + 4))
|
||||
(7 * 4 + 7) + ((6 + 7 * 3 + 7) * 9 + (9 + 6 + 3) * 9 + 9) * 2
|
||||
8 + (5 * (3 * 2 + 7 + 2) + (7 + 6)) * 9
|
||||
8 * (6 + 5 + 8 * 3 * 8 * 6) * 8 * 9 * ((4 * 5) * 2 * (2 * 3 * 8)) + 5
|
||||
5 + 5 + 5 * 2 * 2 + 4
|
||||
(3 + 3 * 5 * 3 * (2 + 9 * 4 + 2 + 2 * 6)) + 4 + (8 * 9 + (9 * 8) + 9 + 7)
|
||||
(9 * (3 + 2) * (8 * 8 * 5 * 4) * (9 * 4 + 8)) + 8 + 6 + 3 * 8
|
||||
(2 * 2 + 9) + 5 * 8 * (3 * 4)
|
||||
6 * 9 + 3 * (9 + 8 + 7 * (6 * 9 * 4 * 2)) + 4
|
||||
((6 + 9 + 9 + 6) * 2 * 8) * 3
|
||||
4 * (4 * (8 + 5 * 2 * 2 + 3 + 4) * (8 + 3 * 5 * 5)) * 9 + 3 * (6 + (9 + 2) + 8 + (2 + 3) + 7 * 6) + (4 * 4)
|
||||
(8 * 8 * 5 + 2) * 9 * 8 + 8 * 4 * 2
|
||||
4 * 9 + 8 + 4 * 6
|
||||
4 * ((6 + 2 * 8) * 9 * 9) + 7 + 5 + 9 + 8
|
||||
(4 * 6 * 2 + 9 + 6 + 6) + (4 + 2) + 6 + 3 + (6 + (5 + 7 + 8 + 3) * 7 + (4 * 5 + 6 + 9 * 7 * 4))
|
||||
9 * 7 + ((2 * 7 + 3 * 9 + 3 + 9) + (6 * 8))
|
||||
(7 + 6) + 9 * 8 * 9 + 6
|
||||
3 * 3 * 4 + (2 * 9 * (6 + 2 * 4 + 9 * 8) + (7 * 9 + 4 + 4 * 4 * 6) * 8 + 8) + 5 + ((7 + 7 * 9 * 8) * 4 + 4 + (5 + 5 + 6 + 6) + 4 + 8)
|
||||
(4 * 9 + 8 + (4 * 2 + 5 * 3 * 7 * 2) * 5 * 2) * (4 + (8 + 5) + 9 + 3 * (9 * 4 * 5 + 4 + 2)) * 3 * 3 * 9
|
||||
(5 * (7 * 2 + 9 * 2) * 6) + 9
|
||||
((3 * 2 * 6 + 3 * 7) * 6 * (9 + 6 * 7 + 4 * 5) + 6 * 9 * 3) + ((6 + 3) * 3 + (5 * 5 + 7 + 5 + 4) + 2 + (9 + 2 + 9 * 2) + 2) + 6 + (6 * 7 + (7 * 3 * 5) * 2 + 3 * 7) * (6 + (8 * 6 + 4 + 6 + 2 * 8))
|
||||
8 * 3 + 2 * (6 + (2 + 9 * 8) * 2 * 9)
|
||||
(9 * (7 + 3 * 8 * 5) + 7 + 3 + (4 * 2 * 3) + (7 + 2 + 2 + 3 * 7)) + 5 * ((6 * 5) * (9 * 4 * 8 * 2 * 2 * 5) * 9 * 2)
|
||||
5 + ((2 * 4 * 9) * 6) + (9 + 7 + 2 * (2 + 5 + 6 + 2)) * 9
|
||||
9 * 6 * (9 + 5) * 2
|
||||
9 * 2 * 2 + 6 + (8 + (5 * 5 * 6 * 6 + 4 + 7) + 6) + ((3 * 7) * 4 * (2 * 6 + 9 + 2))
|
||||
(2 + 4) * 5 + 5
|
||||
(7 + 8 * 2 + 5 + 3 + (3 + 4 * 9 * 9 + 4)) + 2 * 8 + 3
|
||||
3 + 9 + 5 + (8 + 3 + (9 + 8 * 6)) * 8
|
||||
8 * (6 * (2 * 3 + 5 + 9 * 7 * 8) * 2 * 5 + 5) + 7 * 2
|
||||
3 * (3 + 3 + 2) * 6 * (8 * 6 + 5)
|
||||
6 + (8 + 2 + 5) + (5 + 4 * (3 + 3) + 3) + 4 + 9
|
||||
(5 * 5 * 3) + ((4 * 4 * 9 + 8) + 9) * 2
|
||||
2 * (4 * 3) * 2 + 3
|
||||
7 * 2 * 5 + 4 + 5 + (8 * 7)
|
||||
3 + (4 * 6 + 4 * 8 * (6 + 7 * 7 * 7 + 5))
|
||||
3 * (8 + 5 + (6 + 6 * 8 * 7 + 6 * 8) + 3 + 2 * 5) + 3 + 9 + 6 + 5
|
||||
6 + (2 * 6 * 4 * 9 + 4) * (9 * (7 * 4 + 4 * 5 + 2))
|
||||
(7 * 3) * (5 * 6 + 9 * 6) * 2 * (9 * 7 + 7 + (2 * 4 * 6 + 9) + 9 + 9) * 4 * 4
|
||||
(4 * (8 * 3 + 3 * 2) * 7) * 2 * 3 * 9 * 5 * (3 + (2 + 9) * 5 + 7 * (6 + 9 * 2 * 2 + 9) * 9)
|
||||
3 + 9 * 7 + ((3 + 4) + (4 * 3 * 4 * 2 + 2) + 9 * 4)
|
||||
3 + 6 + 2 + ((2 * 9 * 4) + 5 + 5 * 5 + 8 + 4) * (7 * (9 + 5 + 7 + 5 * 2 + 7)) * 3
|
||||
5 * ((2 * 9 + 8) + 4 * 7 * 5) * (5 + 5 + (9 + 8 + 7 + 5 + 5) + 2 + 8) + 7 * 6
|
||||
9 + ((7 * 3 + 4 + 3 * 3 + 7) * 5) + (8 + 2 * 6 * (8 * 9) * 4 * 7)
|
||||
4 + 3 + 6 + 3 * 5 + (8 * 4 * 2)
|
||||
(9 + (2 * 4 + 6 * 3) + 7 * (4 + 6) + 3 + (6 + 2 + 8 + 9 + 5 * 7)) + (9 + 3 + 4) * 3 + (8 * 4) + 9
|
||||
8 + 8 * (6 + 9 + 2) * 6
|
||||
4 + 7 + (3 + 4 + 5 + 7) + (5 + (9 + 6 + 8 + 7 * 3) * 3 * 7 * (2 * 4 + 3 + 6) + (8 * 9 * 2 + 6 * 6 * 5))
|
||||
(2 * 7 + 4 + 8 * 8) + 3 + 7
|
||||
(4 * 3 * 4 + 3 + 8 + 5) + (8 * 6 * 5) * 9 * 7 * 7 * ((7 * 5 + 8 * 4 + 2) * 8)
|
||||
4 + ((9 * 9) + (6 + 2)) + 9
|
||||
((8 * 3 + 3 * 6 + 5) * 5) * 6 * 8 + 5 * (3 + 9 + 5)
|
||||
8 * ((9 + 6 + 3 * 2 + 4) * 9 * 3 * (6 + 7 * 6 * 2)) + (3 * 4 * (3 * 9) + (9 + 9)) + 2
|
||||
8 * (6 + (6 * 6 + 5 * 4 * 2) + 7 + 5 * 5 + (8 + 9)) + 3 * (4 * (9 + 4 * 9) * (2 * 6 * 4 + 3 + 2) + (7 + 3 + 5 + 6)) * 5 + (3 + 9 * 6 + (3 * 4 * 8 + 7 * 7))
|
||||
5 + 8 * 3 * 8 + 9
|
||||
3 + (4 * 8 + (5 + 5 + 3 + 9 + 2 + 6)) + ((4 + 9) + (8 * 7 + 3 + 6 * 6) + 7)
|
||||
(2 * 2 + 7 + 2 * (9 * 2)) * 3
|
||||
7 * 3 + 2 + 9 * ((2 + 2 + 3 * 4 + 2) + (4 * 9 * 5 + 9 + 8) * 3)
|
||||
(8 * 6 + 4) + (7 + 8 + 3) + 4 + 9
|
||||
(4 * 6 * 5 * 6) + (2 * 4 * (5 * 9 * 8 + 7) * 2 * 3 + 6)
|
||||
(6 * 5) * (3 + 2 * 3 * 9 * 4)
|
||||
9 + 4 + (3 + 3 * (7 + 2) * 5) * (5 + 8 + 5 * 8 * 2)
|
||||
(3 * 4) + ((3 + 4 * 9 * 7 * 5) * 6 * 8 + 6) * 5
|
||||
3 + (8 * (8 * 7 * 2) * 8 * 3 + (9 + 9 + 5) * (3 * 4 + 3)) + 5 * 7
|
||||
6 * 3 + 8 + (7 * (5 + 8 + 9 + 5 * 6 * 3) * 3 * 8 * 6 + 5) + 6
|
||||
7 * 8
|
||||
3 + 7 * (7 + 9 * 4 * 2 + 9 * 7)
|
||||
(4 * 7 * 4) * (3 + 5 * 6 * 6 * 2 + 6) * 8
|
||||
8 * 5
|
||||
(7 * 8 + 4 + 8 * (4 + 7 * 5 + 7 * 5)) * 3 + 3 * 8 + 9 + 6
|
||||
8 * (8 + (5 * 5 * 5 + 9) * (8 + 6)) * (6 + 2 * 9) * 2 * 3 + 6
|
||||
(6 * 8 * (5 + 2)) + (3 + 6 + (9 + 9 * 2) * 3) * 8 * 4 * 7 + 8
|
||||
(3 * 9 * 2 + (8 + 8) + 9) + 2
|
||||
(8 * 2) * (8 * 6 * 4 + 6 + 3 + 3)
|
||||
7 + 5 + (3 + 2 * 2) + 5 + (6 * 8) * (7 + 6 + 6 * 9)
|
||||
(3 * (2 + 9 * 5 * 8 * 7) + 9 + 4) + 9 * 5
|
||||
5 + 3 + (5 + 8 + 4 * 5 + 8 + (5 * 3 + 7 * 6 + 3 * 8)) * 2 + 7 + 3
|
||||
(5 + 6 + 7 * (9 * 7 * 2 + 3 + 8) * 8) * 4 + 2
|
||||
6 + (2 + 5 + 2 * 7 * 7 + 6) * 8
|
||||
8 * 8 + (7 * 4 + 2 * (6 + 5 + 2) + (3 * 2 + 8 + 9 * 7)) * (3 * (2 + 9 + 9 * 4 + 2 * 9) * 4)
|
||||
(5 + 8 + 8 * 8 * 9 * 6) * 3 + 5 + 7
|
||||
8 + 5 + 6 * ((6 + 7) * 5 * 2 * 9 * 3 + 2) + 2 * 4
|
||||
(8 * 4 + 5 * 7 * (7 + 7 + 3 + 7 + 9) + 9) + (3 * 2 + (7 * 7)) * 2 * 6 * 2
|
||||
4 * 6
|
||||
(9 + 8 + 2 * (9 + 7)) * 4 + 2 + ((6 + 9 * 3) + 5 + 5 + 4 + 2 + 8) * 2 * 6
|
||||
(8 + (4 + 9 + 9) * (7 + 6 * 4 * 5 + 7) + 3 * 2 * 5) * (9 * 5 * (2 * 7 + 2 * 6)) + 3 + 8 + 3
|
||||
3 + (7 * (4 * 2) + 7 * 5 + 8 + 6) * 4
|
||||
8 * 7 * 5 * 4 + (2 * 7 * 6)
|
||||
8 * 9 * 5 * ((6 * 4 * 5) + 4 + 2 * 5 * (4 * 4 * 7 + 4 * 6 * 6))
|
||||
8 + 8
|
||||
4 * 3 * 7 + 8 + (8 * 7 + 5 + 7 * 3)
|
||||
(9 + 4 * (6 * 2 + 5 * 6)) + 7 + 7 * 6
|
||||
3 * (8 * 6 + 3) + 2
|
||||
9 + ((7 * 8) + 6 + 5 + (4 * 4 * 9 * 5) * 8)
|
||||
7 * (9 + 8 * 3 * 3)
|
||||
2 + ((6 + 7 + 8) * 4 * 4 * 3) + 6 + (7 * 2 * 4 + 4 * 6)
|
||||
2 + 2 + 6 + 9 * (8 * 2 + 2 + (7 * 8 * 5 + 5) * 7 * 3) + 8
|
||||
(5 + 6 + (9 * 8 + 7 + 2 * 3 * 2) + (9 + 9) * (3 * 3 * 6 * 2 * 3 + 6)) + ((9 + 3) + 2 * 4) * 7 + 2 + 2
|
||||
(4 * (6 * 8 * 5) + (9 + 2)) * (2 + 8 + (2 + 9 * 7 * 5 * 2) + 6 + 8) + 8 + 2 * 4
|
||||
9 + 3 * 7 * 8
|
||||
(6 + 4 + 7 * 6 + 9) + 4 * 4 + 9 * 9
|
||||
(8 + 9 + 9) * (5 * 6)
|
||||
7 + (9 + 4 * 2) * 6 + (9 * (4 + 2)) * 7 * (2 * 7 + 5 + 2 * 6 + 2)
|
||||
4 + 5 * 4 + 5 * 7 * (8 * 5 + 5 + (4 * 8 * 7 + 8) * 3)
|
||||
8 + 5 * (8 * 3 * 5) * 9 * (4 + 6 + 6 * (5 * 9 * 9 + 5 * 7 + 2)) * 8
|
||||
(7 * (6 * 9 * 8) + (8 + 4 * 7 * 2 + 4) + 8 * 3 + (6 + 6 * 3)) * (4 + 4 * 8) * 8 * 7 * 2 * 4
|
||||
(9 + 5 * 5 + 6 + 3) * 9
|
||||
8 * (7 + 6 * 9 + 4 + 9) * 2
|
||||
((9 + 6 * 4 + 7 + 3 + 7) + 5 * 9 + (3 * 9)) + 3 + 7 * (7 + (4 + 5 + 3 * 5)) * 9
|
||||
2 * 6 + 4
|
||||
(6 + 6 + 5) * (5 * 8 + 6 * 5) + (9 * (7 * 6 + 3 * 3 * 4 + 7) + 7) * 4 * 4
|
||||
8 + 6 * 4
|
||||
(3 + 3 + (4 * 6 + 5 + 9 + 7) + (8 + 6) + 8 + 2) * 5 * 6 + 7 * 7 * (9 * 5 * 8 * 7 * 3)
|
||||
((2 + 6 * 8) * 2) + 7
|
||||
6 * 2 * 3 + (4 * 5 * 4 + 2)
|
||||
6 + 4 * (4 + 3 + 2 + 8) * 5 * 4 * 5
|
||||
2 * 4 * 2 + 7 * 4 + (5 + 7 + 3 + (7 * 6 + 8 * 8 + 7) + 4 + 3)
|
||||
8 + 8 * 7 * (4 * 9 + (9 + 4 * 7 * 6)) * 7 + (4 + 4 * (3 * 2))
|
||||
9 + 6 + (8 * (2 + 8) + (3 + 2 + 2 * 4))
|
||||
(4 + 4) + 3 * (9 * (6 * 6 * 4 * 8) + (3 * 8 * 5 + 2 * 2 + 3) * 9 + (8 * 5 + 4 + 8 + 2 + 9)) * 4
|
||||
(3 + 8 * (2 + 2) + (9 + 6 * 3 + 3 * 7 + 5) + 7 + 2) + 8 * 6 + 7
|
||||
7 * 9 + (7 * 3 + (9 * 4)) + 5
|
||||
((9 + 7 + 3 * 6 + 9 + 3) + 9 + (4 * 8)) + 9 + (3 + 8 + (7 * 4) + 3 + 9 * 4) * 9
|
||||
(4 * 8 * 5 * (5 * 5 + 7 * 6 + 2 * 7) * (9 * 6 + 4 * 2 * 2 + 8) + 7) + (4 + 6 + 9 * 8 + 2) + 9
|
||||
8 * (9 + 9 * 6 + 2 * 5 + 2) + 7 + (9 * 8 * 9 * (6 + 5 * 6)) * ((6 * 9 + 2 * 8) * 6 + 5 + 6) + 2
|
||||
(9 + (2 + 2 * 4 * 6) * (6 * 4 * 4 * 7) + (6 * 7 + 9 * 9 * 6 * 8) + 4) * (5 + 5) + 5 + 5 + ((6 + 8 * 2) + 8) + 6
|
||||
8 + (6 + (3 * 7 * 3 + 5 + 4 + 5) * (4 * 7 + 5 + 5 * 4) * 4) * 8 * 7 + 5
|
||||
6 * 2 * 7 * 4 * (3 * 9 * 7 * 2 + 7) + 5
|
||||
9 * ((6 * 2 * 4 + 3 + 8) * 8) * 2 + 7
|
||||
(7 + (7 * 6 * 3 * 6 * 6 * 7) + 8 + 9 * 7 + 6) + 5 * 5 + (3 * (5 * 3 * 5 + 6 * 2 * 6) + (2 + 9)) * 3
|
||||
((6 * 7) * 6) + 4
|
||||
6 + 6 + 9 + 7 * (8 * 2 * (7 * 7 + 9) + 2 * 4) + 6
|
||||
2 + 4 * (2 * 8 + 2) + 3 + (3 * 9 * 2 + 5 + 5 * (3 * 3))
|
||||
6 + 8 + (6 + 6) * 3 + ((6 + 7 + 4 * 5) * (9 + 3 + 3)) + (3 * (3 * 8 * 4 * 7) * 6 * 2 * 4 + 6)
|
||||
3 * 9 + (3 * 6 + (2 * 9 * 7 * 5 * 8) * (6 * 9 * 7 * 7 * 3) + 6)
|
||||
7 + (8 + (3 + 3 + 2 + 4) + (8 * 7 + 8) + 9)
|
||||
4 * ((7 * 4 + 3) + 9 * 4 * (3 + 5 * 6) + 8 + 6) * 8 * 8
|
||||
9 + 9 * 2 + 2 * 6
|
||||
(5 + (9 + 4 * 5) * 9) * 7 + 8 * 7 + 5 * 8
|
||||
(3 * (6 + 8 * 7 * 8 + 3) + 9 * 7 + 6) + 9 + 3 * 3 * ((3 + 5 + 3 + 4 + 8) + 2 * 4)
|
||||
((4 + 4 + 4 + 9 * 7) * 7 + 9 + 2 * 7 + 9) * 5 * 5 * 8 * (4 * 8 * 4 + 8)
|
||||
(5 + 5) + 3
|
||||
4 * ((5 * 8 + 9) + 8 * 9 * (2 + 4 * 9 + 5 + 8 * 2) * 2 + 6) * 5 * 8
|
||||
5 * (7 + 7 + 7 * (6 + 5 * 5 + 2)) + 3 + 3 * 3
|
||||
4 * (9 * (3 + 3 * 9 * 2) * (8 * 3 + 6 + 3 + 3) * 5 + 5 * 8) + (3 * 4 + 8 + 2) + 8
|
||||
(4 * 8) + 9 * (6 + 2) * 3
|
||||
9 * 7 + (2 + 3 + 4 + (2 * 2) * (5 * 4 * 5 * 3))
|
||||
5 + ((4 + 8) * 9) * 9 * 5
|
||||
9 + (5 + 8 + 9) + 5 + 4
|
||||
(6 + 6 + (6 + 4 + 7 * 7) + 9) + 9 + (5 * 6 + 9 + 4 + (4 + 2 + 5 + 2) + 7) * 4 + 6
|
||||
(4 * (6 + 5 * 6 * 5) * 5 * 3) + 5 * 6 * 9 + 4 * 8
|
||||
(8 + 2 * 2 + 8) + 2 + ((2 + 9 + 3 + 7) + 8) * (3 * 9 + 3 + 8) + 2
|
||||
2 * 2 * 4 * 5 * 6 * 8
|
||||
2 + 8 * 7 + 3 * (5 * 8 + 6 + 3 + 4 + 7) * 5
|
||||
3 * (4 * 3 + 5 + 8 + 8) + 2 * 9 * 9 * 4
|
||||
((7 * 4 + 5 + 8 * 5) * (2 * 8 + 3 + 5) + (7 * 2 + 9) + 9) * 3 + 9 + 9 * 9
|
||||
4 + 9 + (7 * 7) + 5 + (8 + 2)
|
||||
((8 + 2 * 3 * 2 * 4) + 8 * 8) + 2 + 3 * ((7 * 6 + 6 * 4) + 9 + 9 * 8) * 5
|
||||
(5 * 7 * 7) + 5 + (4 + 7 + 5 + (4 + 7 * 9) + 9 * 9) * 2
|
||||
5 * 9 * (8 + 6 * (5 + 5 + 6 * 8) + 8 * 4) + (7 * 8) * 8
|
||||
4 * (2 * (7 + 7 * 7 + 8 * 9 * 2) + 8 * 2 + 6)
|
||||
((5 + 2 * 3 * 4) + (2 + 5 + 3 + 3) * (2 * 5 + 8) * 8) + 4 + 8 + 7 * 9
|
||||
(9 + 7) + 8 * 9 * (9 + 2 * 6 + 8) + 4
|
||||
(9 + 7) * 5 * 7 * (4 + 6 * 4 * (6 * 7 + 5 * 3)) * 8 + 3
|
||||
7 * (3 + 2) * 2 + 9 * (8 + 9 + (8 + 9 + 6)) * 8
|
||||
(5 * 8 * 9 * 9) + 4
|
||||
7 * 5 + ((3 * 2 + 4) * 5 + 7) + ((7 * 3 * 8) * 4 * 7)
|
||||
(9 + 9) + (6 * 6 * 7) + 6 * 3
|
||||
3 + 9 + 9 * 5 * (7 + 3 * (4 * 5 + 9) * 5)
|
||||
3 * 8 + 9 * (2 + (2 * 3 * 7 + 8 * 4) + 9 * 8 + 7) * 7 * 4
|
||||
4 + 9 * (7 * 9 + (5 * 9 + 8))
|
||||
(2 * (7 * 5 + 6 * 6 + 5 * 2) * 5) * 5
|
||||
((8 + 2 + 6) * (5 * 3) + 8) + 7 + 7 + 7 * 9
|
||||
(3 * 3 * 8 + 9 + 3 * 3) + 4
|
||||
7 * 8 * 6 + 3 * 2 + 3
|
||||
7 * 3 + (2 * 3) * 5 + 6
|
||||
9 * (6 * (4 + 2 * 8 + 6) + 5 * 2 * 2)
|
||||
(4 * (4 * 6 + 9) * (4 * 2 * 4) + 3 + 3) + ((4 + 8) * 2 + 6 * 9) * 6 + 9
|
||||
5 + (4 * (5 + 7 + 5 + 7) * (9 * 3 * 9 * 7))
|
||||
6 * (5 + 9 * 8 + 5 + 8) * (8 + 2)
|
||||
(8 + 3) * 6 + (8 + 2 * 5 * 2)
|
||||
(6 + 6 * (8 * 6)) + ((2 * 5 + 3 + 5 + 5 + 8) * 8 * 4 * (6 * 8 + 7 * 9 + 5) * 8)
|
||||
5 * 4 * 5 * 9 + 2 * 4
|
||||
8 * 7 * (5 * (6 + 7 + 9 + 3 + 9 + 5) + (6 * 3 * 3) * 4 * 6)
|
||||
2 + (8 * 6 + 9 * (7 * 8 + 6 * 3 * 6 + 5) + 6 + (7 * 4 + 4 * 7)) + 9 + 5
|
||||
7 + 9 * 6 + (5 + 8 * 6 + 9) + 6
|
||||
(2 + 4 * (5 * 9) + 5) * 8 * 4 * 5 * 8
|
||||
8 + 7 + 5 + 9 * 7
|
||||
3 * 4 * 5 * 8 * (4 * 3)
|
||||
(4 + 8 + 4 * 5 * (2 + 5 + 9 * 7 * 2 + 7)) * 3 * 5 * 2 + 5
|
||||
7 + (4 * 8 + 9 * 3) + 6 * 3 * (6 + 5 + 7 * 3) * 5
|
||||
((9 * 6) + 8 * 6) + (9 + 9 * 6 + 9) + (8 * 6 + 5 * 4 + 3) + 5 * 4 * (6 + 5 * 3 * 9 + 6 + (5 + 8 * 2 + 7))
|
||||
(7 + (5 + 8 * 2) + (4 + 8 * 7 + 9 * 5) * 9 * 5 * (2 + 8 * 9 + 3 * 2 + 5)) * 9 + 5
|
||||
(7 + 8 * 7 + 7 * 8 * 9) + 7 + 6 * 5 * (5 * 4 + 5)
|
||||
4 * (2 + 4 + 4)
|
||||
(3 * (9 * 8 + 6 * 4 + 6)) + 5 * 3 + 2 + (4 + 5 + 8)
|
||||
6 + 6 * 6 + ((7 * 4 + 7) * 6 + 9)
|
||||
6 + 6 + (2 + 4 + 5 + 5 * 9) * 2 * 4 + (3 * 8 * 6 + 9)
|
||||
(2 + 7 + (5 * 5 * 7 + 8) * 5) + 4 + 3
|
||||
(7 * 7 + 8 + 9) * 2 + 5
|
||||
5 * (5 * 2 + 2 * 9 * 5) + (2 + 8 * 3 * 4 + 2 * 8) * 8
|
||||
2 * 6 * 4 + (8 * 9 * 8 * 4 * 3) + 7 + 3
|
||||
(9 * 4 * 8) * 5 * (5 * 7 * (3 + 3 * 6 * 2) * 5 + 7 * 2) + (2 + 8 * 2) * 2 + 5
|
||||
5 * (7 * 2 + 6 * 9 * 3 + (3 + 2 + 6 + 7))
|
||||
(2 * (4 * 2) * 7) + 3
|
||||
5 * (3 + 2 * 5) * 5 + 8 + 3
|
||||
(5 + 6 + 6 * 2) * 5 * (5 + 8 + (9 * 8 * 4) + 9) + 9 * 7 * (3 * 8 * 8 * 3 * 8)
|
||||
((7 * 9 + 8) + 6) * ((9 + 7 * 8 + 6) * (4 * 4 * 4 * 8 + 5 + 6) * 8 * 7 + 4 * (2 * 2 + 3))
|
||||
(5 + (4 + 7 + 8 + 6 * 8 + 5)) + (8 * (7 + 4 * 7) * (8 + 8 * 5 * 6 * 4) + 9 + (3 + 4 * 6)) + 3 + 2 + 3
|
||||
8 + (8 * 7 + 5 + 3) + 7 + (8 + (5 * 5)) * 6
|
||||
2 + 4 + 4 * 9
|
||||
7 * 4 * 2 + 4 + 3 + (8 * 6 * 6 + (5 * 2 * 6 * 9 * 7) + 7)
|
||||
8 * (5 * 3 + 2 * 6 + (6 * 5 * 4)) * 8 + (4 * (2 + 7 * 3 + 9) + (2 * 3)) + (4 * 3 + 6 * 3 * 7 * 3)
|
||||
9 + 6 * (3 * 9 + 2 + 3 + 6) + 5
|
||||
(9 * 6 + 8 + 8) + 8 + 6 * 9
|
||||
((6 * 9 + 2 + 8 + 4) + 6 * 7 + 8 + (2 + 5 + 7 + 5 + 3 * 8) * 5) * 6 + (2 + 4) * 7 + (3 + 2 * (4 * 8 * 5) * 2 + 7 * 9)
|
||||
(2 + (5 + 9 * 7 + 6) * 2 + 7 * (4 * 6)) * 9 * (7 + (8 + 5 * 3) + 3) * 5 * 3 * 5
|
||||
(7 + (8 + 5 * 7 * 2)) + 2 * 7 + (2 * 5 + 7) * 8
|
||||
4 + 8 + (2 + 9 + 4)
|
||||
((3 + 7) + 7 + 5) + 2
|
||||
6 + 8 + 9 * 2 + 9 + (6 + 4 + 3 * 4)
|
||||
(9 + 2) * 7 + 7 + (3 + 4) + (8 + 3 + 3 + 5) + (2 * 7 + 5 + 4 + 3 + 8)
|
||||
3 * ((7 + 9) + 5 + 9 * (9 + 6) * 3 * (9 + 2))
|
||||
(7 * 3 * (5 + 2 + 5 + 8 * 3 + 7) * 3 * 3 * 6) * 4 + 8 + 3 * 5
|
||||
4 * (5 + 7 * 6 * 5 * 2) + 6 + 3
|
||||
7 * 6
|
||||
9 + (2 * 7 * (8 + 2 + 5) * 8) + (7 * 8 + 9 * 7)
|
||||
(4 + (8 * 5 * 9) * 2 + 8 * 4 + 4) + ((3 * 9) + 6 * 3 * (3 + 9 + 6 * 2 + 5) * 7) * (2 * (5 * 5 * 2 * 6 * 9)) * 6 * 9
|
||||
(7 + (4 + 9 * 2 + 8)) * 6 * 8 + 7
|
||||
8 + (8 + 5) * (3 + 3)
|
||||
5 + 3 * 9 + 2 * (3 + 7 * (6 + 2 * 4 + 3 + 3) * 5)
|
||||
5 * 9 * (3 + 9 * (4 * 6 + 2 + 3 + 3) * 4 + 8 * 4) * 8
|
||||
3 * (9 * 8 + 4 + 5) + ((2 * 6) * 2 * (3 + 6 + 6) + 3) * 7
|
||||
8 * (6 + 4 * 8 * 8 * 4)
|
||||
(6 + 8 * 8 * 2 * (2 * 9 * 3 + 3) + 7) * 5
|
||||
4 * 5 * (3 + (9 + 3 * 6 + 9 + 7) * 5 * (2 * 4 * 8 * 2) + 6 + 2) + 5
|
||||
2 * 5 * (8 * 5 * 4) + (7 * 2) * (7 + 5 + 6 * 6)
|
||||
5 + 3 * 3 * 7
|
||||
9 * (3 + 7 * 3 + 7) * 2 * (6 * 7 + 3) + 4 + 5
|
||||
4 + 6 + 7
|
||||
9 + 2 * (6 + 5 * 5 + 4) * 6
|
||||
5 * 7 * (5 * 9 + 4 * 3 * (7 * 6 + 3 + 3 * 6 * 9))
|
||||
9 + ((3 * 7 * 9 * 6 * 5) * 6 + 9 * 4 * 8 + (6 * 5 + 7 + 9 * 3)) + 3 * (9 + 2) + 3
|
||||
7 + 3 + 6 * 6 * (7 * 4 + 9 + 7) + 4
|
||||
6 + 8 * (7 + 2 + 2 * 7 + (8 * 9 * 2 * 7)) * 2 * 9 + 7
|
||||
(9 * 6 + 7 + 2) + 3 * (4 * 2 * (3 * 6 + 5 + 3 * 8 + 6) * (3 + 4 + 9 * 7 * 2) * 7 * 9) + (6 * 6 + 4) + 5
|
||||
8 * (3 * 9) * 6 + (5 * 2 + 9 * 3) * 4 + (5 * 7)
|
||||
7 + 4 + (7 + 6 * 7 * 8) * (8 * 3 + (4 + 5 + 3 * 9 + 6 + 5) + 8 * 5 + 5) * 3
|
||||
4 * (4 + 9) + (7 + 5) + 3 + 7 + 9
|
||||
3 + (8 * 9 * 3) * 9 + 2 * (7 * 4 * 3)
|
||||
6 * 2 + ((2 + 4 + 5 + 8 + 2 + 6) + 8 * 9) * 9 * 5 + 7
|
||||
6 + ((3 + 2 + 9 + 9) + 8 * 2 * 6 + 4) + 3 * 6 + 4 * 9
|
||||
(3 * 5 + 7) + ((7 * 7 + 5 + 8 * 3 * 2) + 9 * (9 + 4 * 3 + 7) + 6) + 7 + 3
|
||||
(4 * (3 * 7 + 9 * 2 + 6)) * 5 + 9 + 7 + 4 + 7
|
||||
8 * 5 * 4 + 7 * (4 + 7 * (9 + 6 + 2 + 9)) + 9
|
||||
8 + 4 * 3
|
||||
7 + 2 + (4 * 3 * 9 + 9 * 7 * 9) * 7
|
||||
3 * 6 * 9 + (4 + 9 * 4 + 3) * 3 + 6
|
||||
3 * (3 + 7 * 6 + 4 * 4) * (9 + 5 * 5 + 6 + 7 * 5) * (3 + 7) + 4
|
||||
9 + 6 * ((3 + 7 * 6 + 9 * 4 * 4) + 5 + 5 * 3 + (4 * 6 + 3 * 5)) * 8
|
||||
9 + (5 * 9 + 2 * 4) + ((9 * 8 * 5 * 5 + 8) + 5 * 6 * 6)
|
||||
(4 * (8 + 5 * 4) * 9 * 9 + 5 + 5) + 4 * 7 * 8
|
||||
3 * 5 + (5 * 4 + 9 * 8 * (6 + 4 * 9 + 4 * 7) * 9)
|
||||
((4 + 4) + (6 * 2 + 9 + 3 + 5 + 7)) * 3
|
||||
6 * (9 + 8)
|
||||
6 + 8 + 5 * 7 + (2 * 6 * (6 * 5 * 4 * 6 + 8 * 9) * (9 + 6 * 5 * 9 + 7 * 8) * 8)
|
||||
((9 * 3 + 8 * 4) * 2 * 9 + 7) + 3 + 7 + 6 * 3 * 7
|
||||
(2 + 8 + 7 + 5 + 6 * (8 * 4 + 2)) + 8 + 4 * 4 * (3 + (2 * 6 + 6 * 9 * 8) * 9 + 9 * 5 * (4 + 6 + 3 + 5 * 9)) * 4
|
||||
9 + 4 * (5 + 4 + 7 * (8 + 8 * 2 * 8 * 2 + 3)) + 6 * 3 * (6 * 7)
|
||||
(7 + 9 * 6 * (9 + 7 + 6 + 4 + 4 + 5)) * 4 + 5
|
||||
8 + (8 + 2 * (4 + 5 + 5 + 5 * 3 * 8) + (5 * 6) + 3 + 2) * (7 * (4 * 5) + 3 * 5 * 4)
|
||||
3 * ((4 * 9) + 3 + 8 * 7 * 4) * 4
|
||||
5 * 9 + 8 * 4 + 2 * 3
|
||||
2 * 9 * 4 + 2 * ((3 + 8 + 7 * 9) + 7)
|
||||
(7 * 3 * (8 + 3 + 2 * 5 * 9) * 9 + (7 + 2 * 9 + 5 + 2) * 6) * (9 + 6 + 4 * 9 * 6 + 6)
|
||||
7 * 5 * 5
|
||||
(4 * 7 * 6 * 5) * ((7 + 5 * 3 + 4 * 2) * 5 * 9 + 5 * 6) + 3 * 8 * 5 + 9
|
||||
6 * 6 * (4 + 5 + 6 + 9 + 6 * 3) + 4 + ((7 + 5 + 6 * 7) * 9) * 5
|
||||
3 + 6 * 9 * 5 + 3 * ((9 * 7) * (6 + 8 + 5 + 7 * 8 * 7) + 4 + 4 + 4 + (6 * 7 + 4 + 2 + 5 + 9))
|
||||
9 * ((4 * 2 * 6) * 7 + 4 + 6) + 4 * 4
|
||||
6 + 8 + 5 * 4 * ((2 + 2) * 6 * 9) + 4
|
||||
(8 * 4 + 8) + 3 * 4 + 7 * 9 + (5 * (8 * 7 + 2 + 3 * 4) + 2 + 3 * 8 * 8)
|
||||
7 * 9 + ((2 * 9 * 6 * 6) + (6 * 2) * 7 + (8 + 3 * 6 + 4 * 5)) + 8 * 9
|
||||
8 + ((3 + 3) + 7) * (4 + 3 * 3 * 7 * 7 + 9)
|
||||
(9 + (4 + 6 + 7) + (4 + 4 * 4) + 6 + 4) * 3
|
||||
4 * 6 * ((8 + 3 * 3) + 7 * (5 * 7 * 3) * 3 * 8) * 5 + 2 * 3
|
||||
((6 * 5) + (7 + 6 + 7)) + 2 * 3 * 2
|
||||
5 + 3 * 8 + 4 * (9 + (2 + 7 + 7 * 3 + 8 * 2) + 2 + (3 + 6 * 7 + 5))
|
||||
2 + 7 * 4 * 7 * (7 + 3 + 9 * 5 * (5 + 6 * 6)) + 3
|
||||
((2 * 2 + 7 + 2 + 4) * 7) + 2
|
||||
6 + 4 + 3 + ((9 + 5 + 2) * 4) + 9
|
||||
8 + ((3 * 8 * 7 + 6) * 3 + 6 * 2) * (4 + (2 * 8 * 2 + 9) * (7 + 4 + 7 * 5 + 7) + 3) * 4 * 5
|
||||
4 * (8 * 2 + 8) + ((5 + 5 + 3) * 6 + 5) * (7 * 9 + 7) * (9 * 5)
|
||||
2 + (9 * 4) + ((7 * 3) + 8) + 7
|
||||
4 + 6 * (9 * 2)
|
||||
(8 + 6 + (7 * 2) * 3 + (9 * 2)) + 5 + 8 * 3
|
||||
7 + (4 + 5 * 2 + 8 * 7 + 5) * 4 * 4
|
||||
4 * 4 * 6 + (7 * 3)
|
||||
(9 * 6 + 4 * 6 + (3 * 5 * 2 + 5) * 9) * 2 * (8 * (4 + 9 * 7 + 8 * 2 + 2)) + 5
|
||||
8 + 2 * 7 + 5 * (4 + (8 * 9 + 5 * 5 + 6) + 4 + 3)
|
||||
5 * (3 + (8 + 5 * 2) + 2 + 6 + 7) + (7 * (9 + 4) + 8 + (8 + 9) + 6) + (7 * 6 * 5 + 6 * (9 * 3 * 9 + 4) * 8) * 4 * 4
|
||||
2 + 7 * 8 + ((5 * 3 + 6 + 5 + 4 + 4) + 2 + 9 + 4) * (8 * 2) + 8
|
||||
8 * 9 * 2 + 4 * (7 * 5 + 8 * 5 * 4 + 5)
|
||||
(3 + 9) + ((3 * 2) + 5 + 4 * 8) + 3 * 9 + (3 + 7 + 7 + (5 * 7 * 7 * 9) + 5 * 8) * 5
|
||||
3 * 6 + 3 + 7 + (8 + 7) + 7
|
||||
6 + (7 + 5 + (2 + 8 + 3 * 4 * 3) + (9 + 6 + 4 * 2)) * 4 + (9 + 9 + 3 + 7 + 4 * 4) + 6 * (9 + (7 * 8 * 2))
|
||||
8 + (7 * 6 * 5) + (4 + 3 + 2 + 9) * 6
|
||||
6 + 7 * (7 + 3 + 3 + 9 * 2)
|
||||
(8 * (4 + 3 + 5 + 9 + 3) * 3 + 3 + (9 * 7 + 9 + 9 + 4 + 7)) * (3 * 3 * 3 + 6 * 9) + 2
|
||||
(2 + (4 + 8 + 6 + 9 * 3)) + 2 * 2 * 7
|
||||
4 + 5 + ((5 * 7) * 6 + 9 * 4 * 5 * 6) + 6 + 3 * 8
|
||||
8 * 7 + 5 + 5
|
||||
(3 + (7 * 4 + 3) * 9 + 4 + 7 * 5) + (6 + (3 + 3 * 5) + (6 * 6 * 7))
|
||||
4 * 8 * (7 * 7 * 6) + 6 * (2 * 5 + (6 * 4 * 9 + 2 + 5 * 5) * 7 * 5) * (6 * 6 * 7 * 6)
|
||||
(4 * 4 + 5 + 9 * 9) + 2 + 2 + 9 * 3 * 5
|
||||
((9 + 7 + 6 + 8 + 8) + 4 + 4 * (2 * 5 * 8)) * 4 + 7 * 7 + 4 * (6 + 2 + 7 + 5 * 6)
|
||||
9 + 5 + 9 + 3
|
||||
4 * 6 * 5 + 3 + (7 * (2 + 5 + 2 * 5 + 9) + (2 + 9 + 8 * 9 + 3 * 3)) * 5
|
||||
(3 * 5 * (4 + 2 + 8 + 4 + 7) + 7 * 7) * (6 * 7 + 9 * 7 + 7 + 9)
|
120
aoc2020/src/day18.rs
Normal file
120
aoc2020/src/day18.rs
Normal file
|
@ -0,0 +1,120 @@
|
|||
use std::fmt::Write;
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
|
||||
use nom::{
|
||||
branch::alt,
|
||||
bytes::complete::take_while1,
|
||||
character::complete::{char, one_of},
|
||||
combinator::{eof, map_res},
|
||||
multi::fold_many0,
|
||||
sequence::{delimited, pair, terminated},
|
||||
IResult, Parser,
|
||||
};
|
||||
|
||||
const INPUT: &str = include_str!("../input/day18.txt");
|
||||
|
||||
pub fn run() -> Result<String> {
|
||||
let mut res = String::with_capacity(128);
|
||||
|
||||
writeln!(res, "part 1: {}", part1(INPUT)?)?;
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
fn part1(input: &str) -> Result<u64> {
|
||||
input
|
||||
.lines()
|
||||
.map(|line| line.parse::<Expr>().map(|e| e.eval()))
|
||||
.sum()
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
enum Operator {
|
||||
Addition,
|
||||
Multiplication,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
enum Expr {
|
||||
Num(u64),
|
||||
Op(Box<Expr>, Operator, Box<Expr>),
|
||||
}
|
||||
|
||||
impl Expr {
|
||||
fn eval(&self) -> u64 {
|
||||
match self {
|
||||
Self::Num(val) => *val,
|
||||
Self::Op(lhs, op, rhs) => match op {
|
||||
Operator::Addition => lhs.eval() + rhs.eval(),
|
||||
Operator::Multiplication => lhs.eval() * rhs.eval(),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn operator(input: &str) -> IResult<&str, Operator> {
|
||||
one_of("+*")
|
||||
.map(|op| match op {
|
||||
'+' => Operator::Addition,
|
||||
'*' => Operator::Multiplication,
|
||||
_ => unreachable!(),
|
||||
})
|
||||
.parse(input)
|
||||
}
|
||||
|
||||
fn operator_expr(input: &str) -> IResult<&str, Expr> {
|
||||
let (i, first_term) = term(input)?;
|
||||
|
||||
fold_many0(
|
||||
pair(delimited(char(' '), operator, char(' ')), term),
|
||||
first_term,
|
||||
|acc, (op, val)| Expr::Op(Box::new(acc), op, Box::new(val)),
|
||||
)(i)
|
||||
}
|
||||
|
||||
fn num(input: &str) -> IResult<&str, Expr> {
|
||||
map_res(take_while1(|c: char| c.is_digit(10)), |res: &str| {
|
||||
res.parse().map(Expr::Num)
|
||||
})(input)
|
||||
}
|
||||
|
||||
fn term(input: &str) -> IResult<&str, Expr> {
|
||||
alt((delimited(char('('), expr, char(')')), num))(input)
|
||||
}
|
||||
|
||||
fn expr(input: &str) -> IResult<&str, Expr> {
|
||||
alt((operator_expr, term))(input)
|
||||
}
|
||||
|
||||
impl std::str::FromStr for Expr {
|
||||
type Err = anyhow::Error;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self> {
|
||||
let (_, res) = terminated(expr, eof)(s).map_err(|_| anyhow!("couldn't parse expr"))?;
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn part1_provided() {
|
||||
let tests = &[
|
||||
("1 + 2 * 3 + 4 * 5 + 6", 71),
|
||||
("1 + (2 * 3) + (4 * (5 + 6))", 51),
|
||||
("2 * 3 + (4 * 5)", 26),
|
||||
("5 + (8 * 3 + 9 + 3 * 4 * 3)", 437),
|
||||
("5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4))", 12240),
|
||||
("((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2", 13632),
|
||||
];
|
||||
|
||||
for (expr, expected) in tests {
|
||||
let expr: Expr = expr.parse().unwrap();
|
||||
assert_eq!(expr.eval(), *expected);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,3 +17,4 @@ pub mod day14;
|
|||
pub mod day15;
|
||||
pub mod day16;
|
||||
pub mod day17;
|
||||
pub mod day18;
|
||||
|
|
|
@ -19,6 +19,7 @@ use aoc2020::day14;
|
|||
use aoc2020::day15;
|
||||
use aoc2020::day16;
|
||||
use aoc2020::day17;
|
||||
use aoc2020::day18;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let days: &[DayFunc] = &[
|
||||
|
@ -39,6 +40,7 @@ fn main() -> Result<()> {
|
|||
day15::run,
|
||||
day16::run,
|
||||
day17::run,
|
||||
day18::run,
|
||||
];
|
||||
|
||||
aoc::run(days)
|
||||
|
|
Loading…
Reference in a new issue