Completed day 18
This commit is contained in:
parent
0f038ae1dd
commit
77b0b1901b
170
day18/Cargo.lock
generated
Normal file
170
day18/Cargo.lock
generated
Normal file
@ -0,0 +1,170 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.36"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68803225a7b13e47191bab76f2687382b60d259e8cf37f6e1893658b84bb9479"
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
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 = "cfg-if"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
||||
|
||||
[[package]]
|
||||
name = "day18"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"nom",
|
||||
"peg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "funty"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ba62103ce691c2fd80fbae2213dfdda9ce60804973ac6b6e97de818ea7f52c8"
|
||||
|
||||
[[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",
|
||||
"ryu",
|
||||
"static_assertions",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
|
||||
|
||||
[[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 = "peg"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9f76678828272f177ac33b7e2ac2e3e73cc6c1cd1e3e387928aa69562fa51367"
|
||||
dependencies = [
|
||||
"peg-macros",
|
||||
"peg-runtime",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "peg-macros"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "636d60acf97633e48d266d7415a9355d4389cea327a193f87df395d88cd2b14d"
|
||||
dependencies = [
|
||||
"peg-runtime",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "peg-runtime"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9555b1514d2d99d78150d3c799d4c357a3e2c2a8062cd108e93a06d9057629c5"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
|
||||
dependencies = [
|
||||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "radium"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
|
||||
|
||||
[[package]]
|
||||
name = "static_assertions"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||
|
||||
[[package]]
|
||||
name = "tap"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "36474e732d1affd3a6ed582781b3683df3d0563714c59c39591e8ff707cf078e"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
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 = "wyz"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214"
|
12
day18/Cargo.toml
Normal file
12
day18/Cargo.toml
Normal file
@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "day18"
|
||||
version = "0.1.0"
|
||||
authors = ["Tyler Hallada <tyler@hallada.net>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
nom = "6.0.1"
|
||||
peg = "0.6"
|
373
day18/input/input.txt
Executable file
373
day18/input/input.txt
Executable file
@ -0,0 +1,373 @@
|
||||
3 + 8
|
||||
7 * (7 * 6 + 7 * 5 + (9 + 2 * 2 * 4)) + 7 * 3 * 5
|
||||
3 * 4 + 2 + 7 + (4 * (9 + 9 + 2 + 3 * 8) + 9 + (6 + 4) + 7) + 3
|
||||
(7 * 9 + 2 + (5 + 4)) + 5 + 9
|
||||
4 + 5 * 5 + 8 + (3 * (7 * 7 + 5) * 7) * 5
|
||||
2 + 8 * (5 + 4 * (8 * 3 * 6 * 7 * 8 * 8) + 8 * (7 + 9 + 8 * 9 * 4) * (3 + 9 * 5 + 2 + 5 * 4)) * 4
|
||||
(8 * (3 + 3 * 9) * 3 * 9 * 9) + 3
|
||||
(8 * 2 * 4 + 5) * 2 + 2 + (3 + 4 * 2 * 3 + (4 + 7 + 8 * 7 * 5) * (9 + 9 * 8))
|
||||
(7 + 2 + (2 * 3)) * ((8 + 3 * 4 + 3 + 9 + 4) + 5) + 8 * 7 + 5 * 5
|
||||
7 + (3 + 6 + 8) + (5 * 9 + 7 + 2 + (2 * 9 + 8) + 2) * 9
|
||||
8 + 4 * 4 * 6 + 9 + ((5 + 8) + 7)
|
||||
(6 + (8 + 6 * 8 + 7 + 3 * 3) + 5 + 7 * 6 + 8) * 2 * 2 * 5 * 2 * 4
|
||||
(4 + (7 * 4 + 7 * 3 * 9 + 2) * 6 * 2 + 6) * (8 + 5 * 6 * (3 + 3 * 8 + 3) * 9) + 9
|
||||
7 + 9 * ((5 + 8 * 5 * 6) * 2 * 5) + 9 + 9 * (6 * 8 * 4 + 3)
|
||||
4 + (8 * 7 * 7 + 9) + (7 * 9 + 4) + 5 * 3 + 6
|
||||
7 + (3 + 6) * (5 * (5 * 7 + 5 * 6 + 3 + 3) + (3 * 4) * 8) * 2 * 4
|
||||
2 + (6 * 7 * 8 * 6 + (7 + 4 * 3 + 3 * 2 * 9) + 8) * (3 * 4 * (2 * 9 + 9) * 3) + (8 + (4 + 9 * 5 * 2 + 2) + 3 + (9 * 6) + 5 + 9) * 7 + ((2 * 3) + 3 * 8 * 8 * 6 + 5)
|
||||
9 * 4 + ((5 * 2 + 5 * 5 * 6) * 5 + 9 + 8 * 9)
|
||||
3 + ((6 * 3 * 9 * 4 + 2) + 6 * 8)
|
||||
(3 + 4 + 7 + 3) * (6 + 8 * 7 + 8 + (6 + 6 + 8 * 7)) * 5 * 3
|
||||
2 + 8 + (9 + 4)
|
||||
((5 * 9 * 5) + 7 * 5) + 3 * 8
|
||||
((7 + 9 + 5 + 4) * 9) + ((2 * 2 + 5 * 2 * 7) * (6 + 6 * 7 * 2 + 3) * 8 + 5 + 2 * 6) + 7
|
||||
2 + (9 * 9 + 5 + 6) * 2 * 9 + 3
|
||||
(5 * 4 * (7 * 9) + 7) * 8 * 5 * 4 + 6
|
||||
5 + (7 * 4 * 2) * (8 + 7 + 2 * 2 * 7 * 2)
|
||||
8 * ((5 + 7 + 2 + 9 * 8 * 2) + 9 * 6 * 9 + 7) + 8 * (3 + 5)
|
||||
3 * 3 * 2 + 9 + (8 * 2 * 5 * 2) * 6
|
||||
3 + 5 + 5 + 4
|
||||
2 * 7 + (7 + 2 + 4 * 7 + (9 * 5 + 7 * 6 + 9 + 9) + 2) * 9 + 6 * 6
|
||||
(2 * 6 + 8) * 3
|
||||
4 + (7 + (7 * 7) * 3 + (4 * 5 + 4 + 6 + 3) + 5 * 8)
|
||||
((8 * 9) + 3 * 8 * 7) + ((2 * 4 + 8 * 2 + 8 + 5) + 9 + 4) + 4 + 9 * (7 + 9 * (5 + 7) + 7 * 5 * 8) + 8
|
||||
((2 + 6 + 9) + 5 * 4) * 6
|
||||
9 * 5 * (2 * 6) + 6 + (9 * 2 * 8)
|
||||
3 * 3 * (3 * 9) + 7
|
||||
9 * ((2 + 7 * 7) * 3 + 8 * 3 + (6 * 2 + 5 + 3 * 3 * 9)) + 3 * 5
|
||||
(6 + 6 * 6 * 6 * 3 * 3) * 7 * 4 * 9 * 7
|
||||
2 * ((5 * 4 * 7 + 3) + 6 * (5 * 5 * 2 + 8 * 9 + 5) + 7) + (7 * 8 + 7 + 7 * 9 * 6) * 7 * 8
|
||||
(5 * 8 * 9 * (6 + 7) + (5 * 3 * 3 * 6 + 4 + 6)) + 2 * 7 + 9 * 8
|
||||
2 + (7 + 4 + 8) + (7 + 6 + (2 + 9) * 3)
|
||||
((3 * 2 + 8 + 2) + 7 * 8 + 6) + 9 * 7
|
||||
6 + (9 + 2) * 8 + ((2 + 6) * 7 * 2) * (9 * 6) * 3
|
||||
3 * ((5 + 5 * 3 + 8 + 5 * 2) + (5 * 8 * 4 * 5 + 4 + 8) + 6 + 8 + 5)
|
||||
((4 + 6 + 8 + 8) * 4 * 9 + (6 * 2 + 4 * 5 + 5) + (9 + 4 + 7 + 4 + 5) + 8) * 7 * 5
|
||||
8 + 9 + (5 * 3 * 9 + 5 * (4 * 7 * 6 + 5 + 9)) * 5 * (9 + 8 + 7 + 4) * 6
|
||||
4 * 6 + 9 * (9 + 5 + 7 * 4) + 7
|
||||
(5 * 6) + (2 + 9 + (6 * 2 * 5) + (2 + 8 + 2) + 9) + 7 * 6 + 5
|
||||
5 * 4 * 7 * (5 * 7 + 2) + 5 + 9
|
||||
3 * (7 + 2 + 8 + 7 + 5 + 3)
|
||||
2 * (2 * 5 + 7 + 6 * (8 * 8 * 5 * 4 * 8 + 8)) + 3
|
||||
(7 * 9 * 7) * 2 * 9 + (7 + 3 * 6 + 3 * 3) * 8 + 9
|
||||
5 + 8 * 9 * 7 + (4 + 9 * 5 + 2 * 3) + 4
|
||||
7 + 3 * (3 + 8 + 5 * 6) * (8 + 6 + 8) * (5 + 2 + 8 + 5 + (4 * 6 * 7 * 5 + 4))
|
||||
((6 * 6 * 7 * 2 + 7) + (3 * 7 + 9 + 7 + 5 + 5) + 2 * 8 * 3 + (3 * 9 + 7 + 7 * 7)) * ((6 + 8) * 3 + 2 * 4) + 3 + (6 * 4 + 7 + 2 * 9 * 2)
|
||||
(9 * 7 * 6 + 2) + 9 * 6 + 4 + (5 + 3 * 8)
|
||||
(4 + 2 + 3 + 9) + 6 * 4 + 2 + 9
|
||||
9 + ((5 * 8 * 8 * 2 * 5) + 8 + 7 * 4) + ((6 + 8 + 4 + 5 * 3 * 5) + 5 + 4 * 6 * 3)
|
||||
9 + (6 + 3) + 3 * ((2 + 3) + 8 + 4 + 8 + (2 + 9)) * 4 * 2
|
||||
7 + 8 + (2 + 9 * 9 + 3 * 9) + 6
|
||||
(8 + (8 * 6 + 9 * 4 + 2) + 4 + 9) + 7
|
||||
6 + (2 + (4 * 3 * 5 + 5) + 4) + 6 * 6
|
||||
7 * (3 * 9 * 3) * (7 + (6 + 8 + 4))
|
||||
8 * ((4 * 3 + 8 * 6) + 7 + 6 * 3) + (4 + 5 * (8 * 2 * 6 * 9) + 7)
|
||||
5 * ((8 * 4 + 2 * 9 * 8 + 2) * (3 + 5 + 6 * 9 + 5) * (5 + 9 * 9 + 2 * 8) * 2)
|
||||
(3 * 4 * 5 * 3) * ((8 + 6) + 2 * (6 * 9 + 9 * 9 + 2 * 7) + 6 * 2) * 5 + 4 + 8 + 2
|
||||
8 * (5 + 2 * 2) * 2
|
||||
(3 * 8) + 9 * (6 * 2 + (6 + 3 * 6 + 7 + 8 + 4) + 3 * 9)
|
||||
3 + 6 * (3 + 6 * 8 * 4 * 5 + 2) + (3 + 9 + 2 * 7 * (4 * 3 + 3 + 8) * (8 + 3))
|
||||
4 * (4 + 3 + 7 + 9 * 6) * 2 + 4 + 8 + (2 + 2)
|
||||
((5 + 7 * 2 * 9) + (2 + 3 * 6 + 2 * 5 * 8) * 8 * (8 + 8 * 6) + 5 * (7 * 9)) + 7 * 9 * (6 + 8)
|
||||
5 * 2 * 4 * ((3 * 4) * 6 + 3 + 5 * 5 * 9) + 7 + 8
|
||||
6 + 8 + (9 * 2 * 9 * 9 * 4 + 3) + 9 + (4 + 2)
|
||||
9 + 5 * 7 + 2 * 4 + (4 * 8 + 5)
|
||||
3 + 5 * 8 + 5 * 5
|
||||
(6 + 6 + 9 * 7 + 4 * 5) + 2 + 4 * 9
|
||||
((3 + 2) + 2 * 4 * 4 * 7) * (9 + 8 * 6 * 3 + 4 + 6) + 3 + 9 * (7 + 5 + 5) + 3
|
||||
7 * (8 + 6 * 9 + 8 * 5)
|
||||
9 * 4 + 8 + 2 * 3
|
||||
9 + 2
|
||||
3 + 2 + 9 + 8 + (2 * 9)
|
||||
4 * 9 * (3 * (2 * 7 + 6) + 9 + 7 * 5) + (9 * 3 * 5) * (6 * 4 * 9 * (5 * 7 + 7 + 2 * 7) * (5 * 5 + 8 + 8) + 8)
|
||||
5 * 7 * 4 * (3 * 8 + 6 * 2 * (8 * 2 + 4) * 4) + 7
|
||||
6 * 3 * 2 + (3 * 8) * 4 + 7
|
||||
6 + ((4 * 4) * 3 + 8 + 3 * (3 * 6 + 9 * 3 * 4) + (7 * 8 + 2 + 7 * 4)) + 7 + 2
|
||||
8 * 9 * (2 * 5 + 6 * 7 * 9)
|
||||
9 + (5 + (8 + 2 + 2 * 3)) + 7 * 2
|
||||
(5 + (3 * 8 + 4 * 3) + (3 + 6 * 2 * 9) + (8 + 7 * 7 * 5 + 2 + 9) + 6) * 5 + 7 * ((6 + 2 + 9) * 4 + 4 * 7 * 3) * 8
|
||||
4 * (9 * 4 * 9 * 4 + 4) * 6 * 7
|
||||
3 + 2 * (6 * 5 * 5 * 7 * (7 * 8 + 4)) * 2 * 7 + 4
|
||||
9 * (4 + 4 + 8 + 5 * (7 * 5 + 2 + 8 + 3 + 4) * (2 + 9 * 3))
|
||||
9 + ((9 * 7 * 9 + 4) * 3 + 3) * 2 + 2 * (7 + 6 + 2 * (2 + 8 + 7 + 6) * 5)
|
||||
8 * (7 + 2 + 4 * 9 * 8 * 4) * 8 + 7 * 9 + 2
|
||||
(9 + 4 + (9 * 5 * 2 + 7 * 9 * 9) + 3 + 5 + 6) + (8 + 5 * 8 * 5 + 8 + 2) + 8 * 2
|
||||
((7 + 8 * 6) * 7) + (4 + 3 + (8 + 2 * 9 + 8 + 3 * 3) * (6 + 5 * 4 * 8 + 8)) * 5 * 6 + 5 * 9
|
||||
((8 * 6 + 6) * (6 * 7 * 9) * 3 + (5 * 4 * 9 + 4 + 7 * 2) * 4) + (8 * (8 + 4 + 8 + 2)) + 4
|
||||
(2 + 2 * 4 * 6 + 6) + 4
|
||||
((2 * 4 + 9 * 2 * 3 * 4) * 8 * 5 + 8) * 6 * (5 * (6 * 4 * 9 * 3) + (2 * 2 * 2))
|
||||
(4 + 9 * 2 + 9 + 2 * 7) * (5 * (9 + 7 + 3) + (6 * 4) * (4 + 6) + (3 + 5 + 7))
|
||||
2 + (9 + 5 + 6) + (4 * 5 * 9 + 5 + 2 * 2) + 3
|
||||
((4 + 6 * 2) + 4) + 3 + (3 + 7 * 6 + 7 * 6) + 9 + (3 + 4) * 7
|
||||
6 * 4 + ((6 + 4 + 2 * 6 * 5) + 4 + 4 + 8 + (4 + 2 * 3 + 9) + 9) + 3
|
||||
2 + (4 + 5 + 6 * 2 * (5 * 5 * 9 * 9)) + ((8 + 3 + 9 * 5) * 3 * 2 * 4 + 9 * 3) + (9 * 8 + (7 * 4 + 6 * 9 + 8)) * 7
|
||||
5 + (7 + 3 + 6) * 8 * 5 + 9
|
||||
8 + (5 * (3 * 7 * 9 + 4 + 7)) * 2 + 8 * ((9 + 2 * 9 * 6 + 7 * 7) * 7 * 3 + (4 + 5 + 4 * 7) * (9 + 2) + 6)
|
||||
5 + (6 + 9 + (2 * 6 * 3 * 2) * 4 + 5 * 3)
|
||||
(3 * (3 + 7) * 6) + 5 * 6 * (3 * 2 * 3 * 7 + (3 + 4 + 4 * 7))
|
||||
9 + (2 + 5) * 6 * (5 + 6 + 9 * 6 * 7)
|
||||
6 * 5 * ((3 + 3 * 6 * 7 * 5 * 6) + (3 + 5 * 4 * 5) * 8 * 3 * 9 * 8)
|
||||
(6 + 7 * (5 + 6)) * 6 * 9
|
||||
2 + (3 + 6 + 5 * 3 + 3) + ((6 * 7 + 5 * 8 * 8) + 7 * 8 + 3 * 2) * 9 + 5
|
||||
((3 * 9 + 4) * 5 * 9 * 7) * 8
|
||||
(4 + 6 * 6 + 8 + 4) + 8 * 9 + 8 + 3
|
||||
2 * (8 + (3 * 9 + 2)) * 7
|
||||
2 + (4 + 6 + 4 * 9)
|
||||
5 + 9 + (4 * 8 * (3 * 7 * 9 * 2 * 6) + 7)
|
||||
(3 + 7 * 6 * 9 + (8 * 6 + 8)) + 3 + 3 * 9 + ((9 * 4) + 5)
|
||||
(6 * (9 * 5 + 9) + 4 * 2 + 5) + 5 * ((2 + 9 * 7) * 4 + (6 * 5 + 2 * 6 + 8 + 7) + 7) + (5 * 6 + (2 * 5) + 7)
|
||||
7 + 4 + 2 * (6 * (4 * 4 * 9 * 8 + 5) * 7 + 3)
|
||||
8 + (7 + 8 * 3 * (6 * 8 + 5) * (2 * 9 * 4 * 6 + 7 * 7) + 3)
|
||||
(7 + 9 * (3 * 6 + 5 + 2) + 5 * 2 + 2) * 6 * (3 + (3 * 8 * 6) * 2 * (4 + 5 * 6) * 5 + 5) + 8
|
||||
5 + 5 * 7 * (4 * 2 * 5 + 5) + 4 * 5
|
||||
3 + 4 + 3 + 5 * (2 * (7 + 9) + 2 * 5)
|
||||
(2 * 7 * 7) * 4 + 4
|
||||
((4 * 5 + 6) + 7) + 4 * 3 + 5 * (9 * 7 + 9 + 8 + 6) * 6
|
||||
7 * 6 + 4 + 5 + (5 * 5 * 2) + (5 * 2 + 5 + 6 + (3 + 3 * 4 * 7 * 9))
|
||||
5 * (2 * (6 + 6 + 4 + 4 + 9 + 5) * 4 + 9 * 8 + 2) * 4 * 4
|
||||
2 * 6 * 3 + (7 + (9 * 6 * 5 + 6 * 7) + 2 * 2) * 9 + 5
|
||||
(9 * 6) + (2 * (8 * 4 + 3 + 8 + 8)) * (2 + 4 * 5 + 3 + 4) + (5 * 7 * 7 + 7 * 7)
|
||||
7 * 2 * ((6 * 5) + (3 + 9 * 3) * (4 + 3 + 9 + 8 + 3))
|
||||
8 * ((4 * 4) * (6 + 6 + 3 * 5 * 3) * 4 + 3 * 4) + 5 * (6 * 4 * (5 + 7 + 7 * 5 + 4) * 5) + 7 + 5
|
||||
((6 + 2 * 9 * 2 * 5 * 7) * 7 * 4) * ((4 + 4 + 4) * 8 + 4 * 8) + (6 + 8)
|
||||
2 * 7 + 3 + 4
|
||||
(9 * (4 + 7 * 2 * 6) * (5 * 5 + 2 + 2 * 5)) + 8
|
||||
4 + ((5 + 3) * 4 * 9 + (3 + 5 * 6) * (3 + 8 * 2 + 3)) * 6 + 9
|
||||
7 * (4 + 6 + 2) + 7 * 2 * 7 * 6
|
||||
6 * ((4 * 9 * 5 * 4) * 7) + 4
|
||||
9 * (6 + 4 + 9 * 9) * 4 * 7 + 2 * 9
|
||||
(9 * (4 * 7)) * 8 * ((7 * 8 * 7 * 3 + 8) + 2 * 2 * (5 + 6) + (2 * 6 * 5 * 5))
|
||||
8 + 2 + 2 * 6 * 2 + 8
|
||||
(5 + 3 + 3 * 5 + 4) * (3 * 6 * 7 * (2 + 4 + 3 + 5 * 4) + 8 + 4)
|
||||
(6 + 6 * 4 + 7 + 4) + 9 * 7 + (5 + 7) * 5 * 4
|
||||
((3 * 4 * 8 + 8 * 8 + 9) * 2 + 8) * 5 * 8 + 3
|
||||
2 * 2
|
||||
(9 + (3 + 2 * 3 + 4) * 4 + 8) * 8 + (7 + 6 * 3 * 7 * 4) * 9 + 4 * 8
|
||||
7 + 3 + 6 + 6 + 5 * 2
|
||||
8 + 2 * 3 * 3
|
||||
7 * 6 * (5 + 2 * 6 * 7 * 6 * 2) + 6 + ((7 * 5 + 9 + 4) * 7 * 6 + 9 * 8 * 2) * 5
|
||||
(3 * 3) * 2 + 4 * 2 + 3
|
||||
4 * (5 * 6 * 2 * 4 * (8 + 3 * 5) * 9) + 5
|
||||
(8 + 5 + 7 + (7 + 6 * 7)) * 7 + 2
|
||||
9 * 2 + 8 + (3 * 9 + 6 * (8 + 6 + 8 * 3 * 8)) + ((5 * 5 * 5) * 2)
|
||||
2 * (2 + (8 + 7 * 7) * 9 * 7 * 3 * 9) + 7 + 4 * 3 + 7
|
||||
8 * 4 + (2 + 3 + 4 * 8)
|
||||
((6 + 2 * 6 + 8) + 4 + 4 * 4 + 8 * 7) + 5 * (4 * 4 + 7 + 3 + 2)
|
||||
7 * (2 + 9 * 8 * 2 + 5 + (8 + 9 + 6))
|
||||
2 + 8 + (5 + 8 + 2 * 6) * 4 + 2
|
||||
((9 + 6 * 8 * 4 + 2) * 2 + 4 * 6 * 5) * 5 + 6 * 3 + 4 * 6
|
||||
(9 + (6 * 7 + 2 * 7 * 7) * 6) * 6 * 6 * 4
|
||||
(4 + 2 + 3 + 3 * (8 * 5)) + 6 * 2 * (8 + 7 + 3 + 9 * (2 * 4 * 8 * 6 + 8 * 5))
|
||||
7 * 4 + (9 + 6 + (9 * 4 * 7 * 8 * 3 + 4)) + (2 + 8 + 7 + 5 + 7) * 2 + (8 * 6 + 5 * 6 * 9 * 8)
|
||||
(9 + (3 * 6) * (5 + 2)) + 5 * 7
|
||||
9 + (8 * 4) * 2 * 6
|
||||
8 * 3 * (9 * (7 * 6 + 7) * (7 * 8)) + 3
|
||||
8 * 7 * 6 * (7 * 7 + 3 + 2 * 6) + (8 + 2 + (7 + 9)) + (5 + 5)
|
||||
(2 * 5 * 7 * 8) + 6 * (5 * 8 + 9 * 8) * 7
|
||||
(2 + 8 * 6 + (7 + 9 * 8 + 2)) + 6 + (3 + 4 + 4 * 2 * 4) + 8 * 8
|
||||
7 + ((4 + 7 + 9 * 9 + 7) + (2 * 5 * 8 * 7 * 7 * 8) * 9 + 6 + 9 * 5) * 4 * 4 * (7 + (3 + 7 + 3 + 4) * 6 * (5 + 4))
|
||||
3 + ((6 * 6 + 8 + 6 * 2) + 6 + 3 + 2 * 5 * 7)
|
||||
9 + 8 + 9 * (2 + 7 * 5) * 4
|
||||
9 + (9 * (8 * 7 * 2 * 6 + 2 * 9)) + 7 * 3 * 2 * 5
|
||||
8 * 9 * (2 + 2 * 6 + 6) + 5
|
||||
(6 * 5 + 8 + 8) + 7 * ((4 * 6 * 3 * 8 * 3 * 5) + (5 + 6 * 8 * 3) + 3) * 7 + 6
|
||||
7 + 2 + ((6 * 7) * 8 + 7) + 6 + 3 * 9
|
||||
6 * (2 * 2 + 8 * 4 + 3 * 9) + (6 * 2 * 4 + (2 * 5 + 4 * 8) + 9) * 7
|
||||
7 * 5 * (6 * 2 + (4 * 5 + 2) + (2 * 5 + 5 + 5 * 7 * 6) * (6 + 5 * 8 * 2))
|
||||
9 * ((7 + 7 + 2) + (5 * 5) + (2 + 3 + 2 * 8 * 7) * 7) * 3
|
||||
(7 + 6) + 3 * 3 * 4 * (2 + 7 * 4 * 4 * (5 * 3 + 8 + 6 * 8))
|
||||
4 + ((6 * 3 + 8 * 6) * 3 + (8 * 4 + 9 * 6 + 4 + 3) * 8 * 2) + 4 * 8 * 2 * 9
|
||||
(9 * (3 * 5 + 8 + 3 + 8) * 3 + 9) + 5 + 5 + 8 + 2
|
||||
(6 + 3 * 7 + 9) * 9 * 6
|
||||
(5 * 2 + 2 + 2 * 7) + 7 * 7 + (6 + 7 + 9 + 9 + 5) * 7 * 5
|
||||
5 + 8 * (2 * 2 + (6 * 3 * 6 * 7 + 8) * 4 + 6)
|
||||
4 + (8 + 2 + 9 + (2 + 4) + 4) * 5
|
||||
7 + 8 * ((9 + 8 * 6) * 8 * (4 * 2 + 3 * 7 * 9 + 6) * 2)
|
||||
(8 + (2 * 8 + 6 * 9 * 6 * 4) * (5 + 5) + 6) + 7 * 8 * 8 + 5 * ((5 * 3 * 7 * 2) * 5 + 4 + (2 * 6 + 6 + 2 + 2) * 4 * 2)
|
||||
6 + (9 + 8 + 5 + 7) + 3 * (7 * 6 * 5 * (2 * 8 * 7 * 5) + 3 * 5) + 3
|
||||
9 * (6 * (8 + 4 * 8) + 4)
|
||||
(9 + (5 * 7 * 7 * 8 + 9) + 5 + 5 * (8 * 7 + 2 + 9 + 9) * (9 + 6)) * 3 * ((8 + 3) + 8 * 4 + 2 * (8 + 6 + 4) * 4) + ((8 + 3 + 8 + 7) + 7 * 8 * (7 * 7) + 5) + 9
|
||||
((3 * 4 * 9) + 2 + 8 + 5 + 2 + 3) * (6 * 8 * 8 + 6 + (4 + 6 + 8)) * 2 * 6 + 5 + 9
|
||||
2 + 2 + (9 * (2 + 5 * 8 + 2 * 5 * 5) * 3)
|
||||
(6 * (2 * 8 + 6 * 4 * 9 + 9) + 8) + 3 + (3 + 2 + 2 + 8 * (3 + 4 + 8 * 9 + 2 + 5)) + 3 * 7 + 5
|
||||
(2 + 5) * (2 + 5) * 3 * (2 + 7 + 8) + 2 + 8
|
||||
3 + 8 + (7 * 2 + (9 + 2 + 8 * 4) + 8 * 8) + 4 * (5 + (6 * 5 * 8) + 7 * 8 + 9 + 8)
|
||||
9 + 4 * (4 + (5 * 3 + 7 + 8 + 7 * 4) * 6 + 8 + 9 + 9) * ((4 * 6 + 8) * 9 * 9 * 6)
|
||||
8 + 7 + ((3 * 6 + 2) + (8 * 2) + 3) + 7
|
||||
(6 + 4) * 9 + 9
|
||||
6 * ((8 + 5) + 7 * 3 * 8 * 5 * 5) * 4 + 4
|
||||
7 + ((4 + 7 * 3 * 3 + 8) * 5 * (8 + 2) * (2 + 6 + 5 * 7 * 4 * 8) + (7 + 5 + 2) + 8)
|
||||
9 + 7 + (7 * 8 + 9) + 3 * 6 + 6
|
||||
(5 * 9) + 5 * 2 + 8
|
||||
(9 + 4 + 7) * ((9 * 7) + 9) + (3 * 9) + ((7 * 5 * 2) * (6 + 9 * 8 * 2 + 5 * 6) + 8 + 9 * 8 + (4 * 9 * 2)) + 6
|
||||
4 * 8 + 7 * ((6 + 9 * 2) * (4 * 7)) + 9
|
||||
8 + ((2 + 2 * 6) * 6 + 2 + 4 + 9 + 5) * 3
|
||||
8 + 7
|
||||
3 + 7 + (9 + 4 + (8 * 4 * 7 + 7 * 3 + 5) + (9 + 7 + 2) + 9) + 5 + 5 * 2
|
||||
6 * 7 + (3 + (3 * 3) + 4 + (2 * 7 * 2 * 3) * 7 + 6)
|
||||
5 * (4 + (7 * 7 + 4 * 5 * 2 + 6) * 3 + 5 + (4 * 3 + 3 + 6 * 6) * 7) + 3 + ((2 * 8 * 4 + 8) + 6 + (5 * 9 + 2 * 7) + 4 * 8) * ((3 * 5 * 3 * 9 * 7) + 5 + (3 + 9 + 9 + 2 + 5)) + (3 * 7 + 9)
|
||||
(3 * 7) + 5
|
||||
(2 * 5 * 6 + 6) * 2 * (9 + 3 + 6)
|
||||
2 * 2 + (6 + (4 + 2) + 4 + 9 * 9) + ((9 + 3 + 6) + 2 * 3 * 5 + 3 * 3) * 8 * (2 + (6 + 3 + 2 + 9 * 6 * 6))
|
||||
8 + (6 + 8 * 8 + 3 + (4 * 7 + 6 * 3 + 6 * 8) * 6)
|
||||
(8 * 8 * 4) * 5 * 9 * 9 * ((9 * 2 * 8 * 2) * 4 + (2 + 2) + 8 + 9) * 4
|
||||
(6 * 3 + (8 + 5 * 9 + 2 + 8) * 3 * 7 * 2) + 9 + 8 + 2
|
||||
(2 * 4 * 3) * 4 + 6 + ((5 * 7 * 4) + 7 + 4 + 5)
|
||||
(8 + 5 * 2 + 5 * 3 * 9) * 8 + 8 * 2 * 8 + 5
|
||||
4 + (6 + 6 * 9 * 5) * (4 + 5 * 6 + 8) + 8 + 8
|
||||
6 + (5 + 7) * 3 + (7 + 2 + 4 * 5 + 2 * 4) + (6 + 4 * 5 * 7 + 4 + 5) * (5 + 6 + 8 + 8 + 9)
|
||||
(5 * 7) * 6 * 8 * 9 * 6 * 6
|
||||
6 + 8 + 7 + 3 * (2 + 9 * 7)
|
||||
3 + ((8 * 5 + 8 * 8 * 9 + 8) * 2 + 6) * 2 + (2 + 6)
|
||||
6 + 6 + (3 * 7 * 8 * (3 * 4 + 2 + 2 + 3)) + ((6 * 3 + 9 + 2 + 5 * 9) * 9 + 2 * 7 * 2 + 4) + 9 + 4
|
||||
9 * 8 + ((6 + 8 * 2 + 7 * 6 * 4) + 4 + 3 + 7 + 5)
|
||||
((2 + 9 + 2 * 9 + 3 * 5) * 3 + 3 * 4) * 4 + 4
|
||||
6 * (8 + 7 * 5 * 8 + 2 * 2) + (4 * 4 + 8 + 3) + 3 * 5
|
||||
7 + (8 * 3 * (5 + 7 + 6) + (9 + 9 * 9 * 6 + 4 * 7)) * 7 + 9 + 4
|
||||
6 * (9 + 7 * 6 * 5 * 8) + 5
|
||||
2 * 6 * (4 + (4 * 7 * 2 + 9 * 9) * 5 + 2) + ((5 + 6) * 3) + 8 + 2
|
||||
5 + 4 * 9 + (5 * (8 * 9 + 2 + 3) * 6) * 3 * 5
|
||||
5 + 9 + 9 + (5 + 2 + 8) * 3 * (7 + 6 + (7 * 7 + 7 + 7) * 6 + 7 + 2)
|
||||
(2 + 6 * 4 + 9 * 2 + 2) + ((3 * 8 * 6) + 2 * (9 * 5))
|
||||
5 + 3 * (3 * 5 * 3 * (7 + 6 * 9 + 3 + 8 + 4) * 9) + 2 + 7 * (6 * 8 * 7)
|
||||
(4 + (9 * 5 + 3 + 4 * 5) * 6 + 9 * 6) * 5 * 9
|
||||
4 * (2 + 4 * 4 + (2 + 6 + 8 * 2 * 8 * 8)) * 4 * 6 + 9 + 3
|
||||
(8 + 9 + 4) + 2 + ((5 * 7 * 3 * 9 + 3) * 6 + 4) * 3 + (2 * 5 * 3 * 3) + (7 + 2 * 9)
|
||||
8 + (6 + 4 * 8 * (9 + 6) + 5 * (5 * 8 + 9)) + 2 * 5
|
||||
7 * 5
|
||||
(4 * 3 * 3) + 7 * (8 * 4 + 3 + 9 + 5 + (6 + 4 * 8 + 3 + 7)) * 6 * 9
|
||||
9 * 2 * (9 * 9 + 4 + 2 * 9) * (3 + 5 + 8)
|
||||
3 + (3 + 6 + 8 + 3 * 7) + 6 + (8 + 7 + 5 + (4 + 8 + 5 + 4)) * 6
|
||||
7 * 2 + 3 + 8 + 2
|
||||
9 * 6 * 5 * 9 * (3 * (8 + 9 + 5) * (5 + 3 + 8) + 5) + 5
|
||||
6 + 6 + ((6 + 2 * 7 + 5 + 3) + 4 * (8 * 4 * 2 * 2 + 7)) + 8 + 5 + 3
|
||||
9 + (2 * 7 * 4 * 5 + 6 + 4) * 5 * 2
|
||||
7 + ((2 * 4 + 2 + 4 + 3 + 3) * 9 + 5 + 6)
|
||||
2 * 9 * 8 * (5 + (4 + 5 + 2 + 7))
|
||||
2 * 6 * 4
|
||||
(8 * (9 * 6 * 9 * 2 + 4) * 6 + 7 * 6) * 6
|
||||
8 * (3 * 3 * 4 + 8) * 8 * 7
|
||||
(8 * 3 * 8 * 8 + 4 + 8) + 4 * (9 * 3) * 7
|
||||
((8 * 9 + 2 * 4) * (4 + 3 + 8 + 9 + 8) * (3 * 8 + 7) + 6 * 3) + 5
|
||||
2 + (8 * 9 * (7 + 6) * (4 + 7 + 7 + 7))
|
||||
4 + (8 + 6 + (8 + 6 * 6 + 7 * 9) + (3 + 6 * 5 * 6)) + 5 * 8 * 7 * 9
|
||||
(7 * 7 + 8 * 4 + 4) * 3 + 2 * 4 + 5 * (4 * 7)
|
||||
((4 + 2 * 6 * 8 * 9) + (8 * 5 + 8) * 9) * 9 + 7 * 7 + 9
|
||||
6 + 3 + ((5 + 6 * 6 * 4 * 3 * 6) + 4) + 4 + (6 * 7 * 4 * 7 + 4 * 5) * 4
|
||||
3 * 2 + (4 * 4 * 3)
|
||||
9 + 7 + (8 + 4 * 5 * 7 + 3) * 9 * 6 + 4
|
||||
(3 * 8 + 9 + 8 + 5) + (2 * 6 * (2 * 4)) * 7 + (7 + 9 * (4 + 9 * 2 * 9 * 9) * 2) + (4 * 2 * 3 * 9)
|
||||
2 + 3 * 4 * 6 + 6
|
||||
8 * 4 * 8 + (2 * (5 + 9) * 3) * 6 * 4
|
||||
8 + (5 + 3 * 3) * 8 * (9 * 9 + 3 * (9 + 9 * 5 + 8 * 4 + 4) + 9) * ((5 * 7 * 7) * (9 + 6) * 6)
|
||||
2 + 5 + 7 + 8 * (4 + 9 * 4) + 7
|
||||
(7 + 9 + 7 + 2 * (5 + 3 * 6 * 5) * 4) + 5 + 8 * 3
|
||||
8 * 7 + (4 * 8 * 9 * 7 * 7 * 7) * 5 + 6 * 4
|
||||
((8 + 6 * 9 + 7 + 3) + (8 * 2 + 9 + 6) * 3 * 8 + 9 * 5) + (3 * 8 * 2 * 9 * 5) * 3 + (7 + (7 + 4 + 3) + 3) * (9 + 9 + 6 * 9 + 2 * 9)
|
||||
(9 * 3 + 2 + 5 * 9) * 5 + 6
|
||||
(3 * 6 + 5 * 9 + 2 * 6) + 2 * ((9 * 3) * 2 + (9 + 7) * 4 + (2 * 8 + 2 * 4 * 9) + 7) + 9 * (5 * (6 * 8 * 9) * 4 * 6 + 2) + 2
|
||||
2 + 9 + 6 + (6 + 6) * ((4 * 7 * 6 * 8 + 3 + 3) + 9 + 7) + ((2 * 2 * 6) + (9 + 2 + 6 + 2 + 8) + 4 * 7 * (7 + 4 + 4 * 5 + 8) * 4)
|
||||
7 * 4 + 9 + (5 + 9 + 9 + 4)
|
||||
2 * 8 * 2 + (4 * 9)
|
||||
7 * 3 + (5 + 8 * 4 * (9 + 6 * 8 + 2 * 3 + 9) + 2 * 9) * 9 * 5 + 9
|
||||
2 * (5 * 6 + 8 * 2 + 6) * 3 * 3 + 7
|
||||
(6 * 5) + 8 * 3 + 9 * (7 * 4 * (2 * 6 * 6 * 2)) + 6
|
||||
6 * 5 * 2 * 8 + 8 + (6 * 5 + (7 * 7) + 3 * (9 * 8 * 2 * 5 + 4 + 5))
|
||||
2 + 3 + 7 + (8 * 2 * 2)
|
||||
6 + 3 * ((9 + 7 * 4 + 4 * 3 * 6) + (3 * 5 + 8 + 3 * 3 + 4) * 5 + 5 * 5) * ((4 + 2) + 9 * 4 * 9 * 5)
|
||||
8 + 7 + 6 * 2 * ((8 * 3) * 3) * (2 + 5 * 5 + 5 * 8 + 8)
|
||||
5 * 2 * 8 * 4 * 7 * 2
|
||||
4 * 9 + 8 * ((9 * 5) + 5 * 2 * (6 * 4 + 2) * (2 + 8 * 8 + 8 * 2))
|
||||
3 * 2 + ((8 * 8) * 2 + 8 + 5 * 8 + 9) * ((4 * 7 * 4 + 5 + 6) * 6 * 3)
|
||||
(3 * (3 + 3) * 2 * 3 * (4 * 2 + 9 + 3 * 5 * 3)) * (2 * 2) * 3 + (5 * 5 * 6 + 2 + 2 * 3) + 7 * 2
|
||||
4 * (3 + 2)
|
||||
3 * 9 * 2 + (5 * 7 * 5 + 7 * 5 * 9) + 9
|
||||
2 + (5 * 7) + 3 + 7 * 8 * 8
|
||||
((4 * 6 * 8 + 4 + 4) * (2 + 3 + 5 * 2)) + (2 * 5) + 3
|
||||
9 + (5 * (3 + 8 * 7) + 8 + 4 + 8 * (6 * 2 * 7))
|
||||
9 + 6 + 6 * 3 * (2 + 7 + (5 + 7 + 4) + 3 * 2) + 5
|
||||
7 + (5 * 5 + (4 * 5 + 7 * 4 + 3 + 3) * 4 + 7)
|
||||
9 + 5 + 3 + ((7 + 7 + 2) + (6 + 9 + 7 + 4 * 5 + 7)) + 6 * 6
|
||||
5 * 8 * 2 + ((6 + 6 * 3 + 6 * 8 * 6) + 6 * 3) + 3 * 2
|
||||
(5 + 5 * 5 * (3 * 7 * 3 + 2) + 6 + 6) + 7 * 4 + (6 * (8 * 8 + 5) * 9 * 8 * 8 + 4) + 6
|
||||
(7 + 3 + 6 + 2 * 8 + 5) * 6 * (2 * (3 + 7 + 9 + 6) + 5 + 2) + 8
|
||||
((7 + 4) * 6 * 9) + 5
|
||||
2 * 7 + 5 + 4 + 7
|
||||
9 * (2 * 2 * 7 + 4 * (4 * 6 * 5 * 8))
|
||||
5 * 9 + 8
|
||||
6 * 2 * 8 + (5 + 3 + (8 + 9 + 6))
|
||||
3 * 5 + 9 * (4 + 2 + 9 + (5 * 3) * 3 + 6) * 5
|
||||
4 * 8 + (3 + 9 * 6) * 7 * (7 * 3 * 9 + 8 + 6 + (9 * 9 + 7 + 4)) + 8
|
||||
(2 * 9) * (6 * 8 * 6 + 5)
|
||||
9 * 2 * 3
|
||||
(6 + 2 * 9 + 5) * 6
|
||||
(8 + 3 + 2 * (2 + 8 * 2 + 6 * 2 + 2)) * 2
|
||||
(4 + 8 * 6) * 3 * 6 + 4 * (3 * 2 * 5 + 9 + 9) + 8
|
||||
3 + (9 * (8 + 6 + 8 * 7) * 8 * 7 + 7) * 7 + 8 + (2 + 3 + 6 * 6 + (2 + 4 + 6 + 5 * 3)) * 5
|
||||
((5 + 2) + (7 * 4 * 9 + 3) * (4 + 5 * 8 + 6 * 6) + (9 + 2) * 4) + 6 + 9 * 3 * 4 * 5
|
||||
2 + (7 * 5) + 4 + 3 + (3 * (7 + 2 * 6 * 7 + 6)) + 4
|
||||
2 + 6 + (3 + 2 + (2 + 3) + 7 * 4 * (8 * 7 * 2 * 4 + 8 * 5))
|
||||
4 * 3 + 6 + 5 * (9 + (2 * 4 * 8 * 8 + 8) + 2 + 4) + 9
|
||||
4 * 6 + (9 * 8 * 9 * 5 * 9 + 7) + 7
|
||||
(4 + (9 + 5 + 2 + 4 * 4 + 6) * 5 + 8) + (2 + 8 + (6 + 5 * 8 * 7) + (7 * 5)) + 5
|
||||
3 + 2 + (6 * 9 + 9 * 2) * (7 * (5 * 8) + 9 + 6 * (7 + 7 * 9 + 2 + 4) * 7) * 9
|
||||
5 + 9 * 7 * (8 * (6 + 4 * 5 + 3 * 2 * 4) + (5 + 2) * (6 * 3 * 7 * 6 + 8 + 3))
|
||||
5 * 7 * 2 + 7 * 6 + (2 * 7 + 5 * 5 * (6 + 7 + 5 + 7))
|
||||
4 + 7 * 2
|
||||
9 + ((6 * 7) + (9 + 7 + 7)) * 4
|
||||
5 + 6 * (3 * (8 * 8 * 3 + 4 * 5) + 4 + (2 + 7 + 3))
|
||||
(2 + 7 + 6) + 5 + 7 * 6 * 8 * 9
|
||||
2 * (6 + 9) * 8 * (9 + 4) + 7 + 8
|
||||
5 + 3 * 6 * 9 + (4 * 8 + 3 * 2)
|
||||
9 * (2 + 5 * 5) * 9 + (8 + 2 * (5 + 2 * 7 + 7 + 4 * 9) + 3 * 6 + 9) + 8
|
||||
8 + 4 + (2 + (9 * 2) * 5 * (5 * 8)) * 8 * 7
|
||||
5 * (3 * 5 + 6 * 4) + (7 * 5 * (6 + 6 * 7 * 8 * 6) + 8)
|
||||
5 + (4 * 6) + 6 * 5 + 6
|
||||
7 * 9 + ((6 + 3 + 6 * 4 * 4 * 6) + 7 + (6 + 4 * 7 * 3 + 9 * 6) + 4 + 9) + 6
|
||||
(8 * 6) + (3 * (3 + 2 * 7 * 9 + 9 + 9) * 3 + (2 + 8 * 5))
|
||||
3 * 4 * 6 * 4 * ((2 + 3 * 6) * 9)
|
||||
5 * ((8 * 5 + 7) + 4 + 7 + 6 * (9 * 6 * 3 + 9 * 7 + 2) + (4 + 4)) + 8 * (7 * (2 * 8 * 6) + 8 + 9 + 6) + 7
|
||||
2 * 8 * 5 * ((9 * 4 * 9 + 5 + 2) + (3 * 9) + (6 + 9 * 4 * 9 * 2) * 5 + 5) * 9
|
||||
5 + (7 * 8 + 7) + 2 * 5
|
||||
4 * (7 + 4 + 5 + (6 * 2 + 3)) * (7 * 3 * 7 * 8 * 7) * 2 * 2 + 2
|
||||
(4 + (5 + 5 * 8) + (5 * 5 + 3 * 5) + 6) + 6
|
||||
6 + (8 + 6 * 4 + 8 + (7 * 6) * 6) + 2 + 3
|
||||
(6 + 3) + ((8 * 7 * 6 * 6 + 6 * 7) * 4 * 6 * (3 + 3 * 2)) + 6
|
||||
4 * 2 * 3 * 3 * 7 + 9
|
||||
3 * 4 * 8 * (6 * 6 * 3 + (3 * 9 * 3 * 3 + 6)) + 5 + 4
|
||||
((7 * 2 + 7) + 9) * 2 * 8 * 3 + 3 * 3
|
||||
2 * 3 + ((2 * 5) + 8 * 7 * 5 + (8 * 2 * 4) * 8) * 3 + 7 * 8
|
||||
9 + (4 + 6) * 3
|
||||
(9 + 5) * 3 * 2 * 7 * (6 * 4 * 3)
|
||||
(3 * 3 * (3 * 3 * 5)) * 7 * 8 + (6 * 7 + 4) * 2 * 2
|
||||
(2 + 4 * (9 + 9 * 7 * 9) + 4) + 4 + 3
|
||||
(9 + 4 + 3) * 9 * 3 + 7 * 3
|
||||
6 + 4 + (6 + 2 + 4) + (9 + 7 * 8)
|
||||
7 + 9 + 5 * (3 + 9 * 7 + (5 + 8 + 9 * 4 + 6) * 5 * 8) + 9 * 6
|
||||
(3 * 7 * 7 * 3 + 7) + 4 * 3 + 5
|
||||
(8 + 7 * 2 + 5) * 4 + 7 * 2 + 5 + 3
|
||||
9 * 5 * ((5 * 8 + 2) * 7) + 2
|
||||
8 * 4 * 9 + 2
|
||||
4 + (3 + 5 * 7 * 3 * 8 + 5) * 6 + (3 + 2 + 9) * 5
|
||||
(3 * 5 + 8 * 8 * (7 * 6 + 2 * 6 + 9 * 7) * 9) * 7 * 9 + 9 + 3
|
||||
5 * 9 + 6
|
||||
6 * (8 + 3 + 4)
|
||||
2 + 5 + (4 + 5 + 8 * (8 + 6 * 9 * 8 + 3) * (3 + 9 * 3) + 3) + 7 + 2
|
||||
9 * (6 + 4) * 9 * 4 * 2 * ((4 + 3 + 2 * 9) + 6 + 5 + 8 * 7 + (7 * 7 + 6 + 2 + 8))
|
||||
(7 * 2 * (4 + 2 + 7 * 5 * 6 * 5) * (3 * 4 + 2) + 6) + 9 + 5 + 3
|
||||
4 * 5 * ((5 + 9 * 7 + 2) + 4 * 7 + 9) + 9 + 7
|
||||
7 * 2 * 6 + 9 + 5 * 6
|
||||
3 + 3 * 7 * ((3 * 3 + 2 + 7 * 5 + 2) + 7 * 6 * 2 * 5 * 9) + (4 * 5) + 7
|
||||
9 + ((5 + 5 * 7) + 7 * 2) + 7 + 6
|
||||
4 * 9 * 9 + ((9 + 3 + 7 * 4) * 4 + 2 + 9 + 8 + 6) * 6
|
||||
(6 * 2 * 5 + 4 + 5) + (8 + (8 * 5 + 7 * 7 + 6 * 2) * 6 + 6) + 4 * 8
|
||||
(5 + 6 * 2) * 5 * 6 * (5 * 5) + 9
|
||||
(7 + (9 * 4)) * ((4 + 3 + 5) + 7 * 5)
|
||||
2 * 5 + ((9 * 6 * 3 * 6 + 4) * 9 * 4) * 2 * 3 * (8 + 6)
|
||||
3 * 6 * 5 + 9 * (6 + 4 * 2 + 5 * 6)
|
||||
((7 + 8) + 3 + 7 + (8 * 3 * 6 + 8) * 2) * ((3 * 5 * 9) + 5) * 8 + 8
|
||||
((3 * 4 + 5 + 2) + 6 * 6) * 9
|
||||
4 + 6 * (9 * 6 * 7 + (2 * 5 + 5 * 9 + 6)) * 8
|
||||
4 * (2 + 2 + 9) + 5 + 5 * ((5 + 3) + 4 * 7)
|
||||
6 + 8 * 3 + 4
|
||||
2 + 8 + (8 + (7 + 5 * 3 * 8 * 7 + 2) * 6) + 3
|
156
day18/src/main.rs
Normal file
156
day18/src/main.rs
Normal file
@ -0,0 +1,156 @@
|
||||
extern crate nom;
|
||||
|
||||
use anyhow::Result;
|
||||
use nom::{
|
||||
branch::alt,
|
||||
bytes::complete::tag,
|
||||
character::complete::char,
|
||||
character::complete::{digit1 as digit, space0 as space},
|
||||
combinator::map_res,
|
||||
multi::fold_many0,
|
||||
sequence::{delimited, pair},
|
||||
IResult,
|
||||
};
|
||||
use std::fs::File;
|
||||
use std::io::{BufRead, BufReader};
|
||||
use std::str::FromStr;
|
||||
use std::time::Instant;
|
||||
|
||||
const INPUT: &str = "input/input.txt";
|
||||
|
||||
// From: https://github.com/Geal/nom/blob/master/tests/arithmetic.rs
|
||||
fn flat_parens(i: &str) -> IResult<&str, i64> {
|
||||
delimited(space, delimited(tag("("), flat_expr, tag(")")), space)(i)
|
||||
}
|
||||
|
||||
fn flat_factor(i: &str) -> IResult<&str, i64> {
|
||||
alt((
|
||||
map_res(delimited(space, digit, space), FromStr::from_str),
|
||||
flat_parens,
|
||||
))(i)
|
||||
}
|
||||
|
||||
fn flat_expr(i: &str) -> IResult<&str, i64> {
|
||||
let (i, init) = flat_factor(i)?;
|
||||
|
||||
fold_many0(
|
||||
pair(alt((char('+'), char('*'))), flat_factor),
|
||||
init,
|
||||
|acc, (op, val): (char, i64)| {
|
||||
if op == '+' {
|
||||
acc + val
|
||||
} else if op == '*' {
|
||||
acc * val
|
||||
} else {
|
||||
acc
|
||||
}
|
||||
},
|
||||
)(i)
|
||||
}
|
||||
|
||||
fn precedent_parens(i: &str) -> IResult<&str, i64> {
|
||||
delimited(space, delimited(tag("("), precedent_expr, tag(")")), space)(i)
|
||||
}
|
||||
|
||||
fn precedent_factor(i: &str) -> IResult<&str, i64> {
|
||||
alt((
|
||||
map_res(delimited(space, digit, space), FromStr::from_str),
|
||||
precedent_parens,
|
||||
))(i)
|
||||
}
|
||||
|
||||
fn sum(i: &str) -> IResult<&str, i64> {
|
||||
let (i, init) = precedent_factor(i)?;
|
||||
|
||||
fold_many0(
|
||||
pair(char('+'), precedent_factor),
|
||||
init,
|
||||
|acc, (op, val): (char, i64)| {
|
||||
if op == '+' {
|
||||
acc + val
|
||||
} else {
|
||||
acc
|
||||
}
|
||||
},
|
||||
)(i)
|
||||
}
|
||||
|
||||
fn precedent_expr(i: &str) -> IResult<&str, i64> {
|
||||
let (i, init) = sum(i)?;
|
||||
|
||||
fold_many0(pair(char('*'), sum), init, |acc, (op, val): (char, i64)| {
|
||||
if op == '*' {
|
||||
acc * val
|
||||
} else {
|
||||
acc
|
||||
}
|
||||
})(i)
|
||||
}
|
||||
|
||||
fn solve_part1(input_path: &str) -> Result<i64> {
|
||||
let file = File::open(input_path)?;
|
||||
let reader = BufReader::new(file);
|
||||
Ok(reader
|
||||
.lines()
|
||||
.map(|line| flat_expr(&line.unwrap()).unwrap().1)
|
||||
.sum::<i64>())
|
||||
}
|
||||
|
||||
fn solve_part2(input_path: &str) -> Result<i64> {
|
||||
let file = File::open(input_path)?;
|
||||
let reader = BufReader::new(file);
|
||||
Ok(reader
|
||||
.lines()
|
||||
.map(|line| precedent_expr(&line.unwrap()).unwrap().1)
|
||||
.sum::<i64>())
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut now = Instant::now();
|
||||
println!("Part 1: {}", solve_part1(INPUT).unwrap());
|
||||
println!("(elapsed: {:?})", now.elapsed());
|
||||
now = Instant::now();
|
||||
println!("");
|
||||
println!("Part 2: {}", solve_part2(INPUT).unwrap());
|
||||
println!("(elapsed: {:?})", now.elapsed());
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn solves_part1() {
|
||||
assert_eq!(flat_expr("1 + 2 * 3 + 4 * 5 + 6"), Ok(("", 71)));
|
||||
assert_eq!(flat_expr("1 + (2 * 3) + (4 * (5 + 6))"), Ok(("", 51)));
|
||||
assert_eq!(flat_expr("2 * 3 + (4 * 5)"), Ok(("", 26)));
|
||||
assert_eq!(flat_expr("5 + (8 * 3 + 9 + 3 * 4 * 3)"), Ok(("", 437)));
|
||||
assert_eq!(
|
||||
flat_expr("5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4))"),
|
||||
Ok(("", 12240))
|
||||
);
|
||||
assert_eq!(
|
||||
flat_expr("((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2"),
|
||||
Ok(("", 13632))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn solves_part2() {
|
||||
assert_eq!(precedent_expr("1 + 2 * 3 + 4 * 5 + 6"), Ok(("", 231)));
|
||||
assert_eq!(precedent_expr("1 + (2 * 3) + (4 * (5 + 6))"), Ok(("", 51)));
|
||||
assert_eq!(precedent_expr("2 * 3 + (4 * 5)"), Ok(("", 46)));
|
||||
assert_eq!(
|
||||
precedent_expr("5 + (8 * 3 + 9 + 3 * 4 * 3)"),
|
||||
Ok(("", 1445))
|
||||
);
|
||||
assert_eq!(
|
||||
precedent_expr("5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4))"),
|
||||
Ok(("", 669060))
|
||||
);
|
||||
assert_eq!(
|
||||
precedent_expr("((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2"),
|
||||
Ok(("", 23340))
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user