aoc2023/day12/log
2023-12-14 17:34:34 +01:00

364 lines
9.4 KiB
Plaintext

Compiling day12 v0.1.0 (/home/max/aoc2023/day12)
warning: unused imports: `Deref`, `Index`, `RangeBounds`, `Range`, `borrow::Borrow`
--> src/main.rs:1:50
|
1 | use std::{str::FromStr, slice::SliceIndex, ops::{Index, Deref, RangeBounds, Range, RangeFrom}, borrow::Borrow, io::stdin, collections::Ha...
| ^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `slice::SliceIndex`
--> src/main.rs:1:25
|
1 | use std::{str::FromStr, slice::SliceIndex, ops::{Index, Deref, RangeBounds, Range, RangeFrom}, borrow::Borrow, io::stdin, collections::Ha...
| ^^^^^^^^^^^^^^^^^
warning: variable does not need to be mutable
--> src/main.rs:194:9
|
194 | let mut rows: Vec<Row> = stdin().lines().map(|l| {
| ----^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: methods `enumerate`, `optimize`, and `multiply` are never used
--> src/main.rs:25:8
|
20 | impl Row {
| -------- methods in this implementation
...
25 | fn enumerate<F>(&self, f: &mut F)
| ^^^^^^^^^
...
32 | fn optimize(&mut self) {
| ^^^^^^^^
...
44 | fn multiply(self, n: usize) -> Self {
| ^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: methods `compatible` and `enumerate` are never used
--> src/main.rs:96:8
|
94 | impl <'r> RowView<'r> {
| --------------------- methods in this implementation
95 |
96 | fn compatible(&self, buffer: &[bool]) -> bool {
| ^^^^^^^^^^
...
148 | fn enumerate<F>(&self, buf: &mut [bool], window: RangeFrom<usize>, f: &mut F)
| ^^^^^^^^^
warning: function `pretty` is never used
--> src/main.rs:188:4
|
188 | fn pretty(row: &[bool]) -> String {
| ^^^^^^
warning: `day12` (bin "day12") generated 6 warnings (run `cargo fix --bin "day12"` to apply 2 suggestions)
Finished release [optimized] target(s) in 0.32s
Running `target/release/day12`
Counting solutions for RowView { bits: [None, None, None, Some(false), Some(true), Some(true), Some(true)], pattern: [1, 1, 3], freedom: 0 }
Descending p=0 consumed=0 freedom=0
Trying offset 0
Descending...
Descending p=2 consumed=1 freedom=0
Trying offset 0
Descending...
Descending p=4 consumed=2 freedom=0
Trying offset 0
Descending...
Descending p=8 consumed=3 freedom=0
no blocks remain
1 at position 5
1 at position 3
1 at position 1
Counting solutions for RowView { bits: [Some(false), None, None, Some(false), Some(false), None, None, Some(false), Some(false), Some(false), None, Some(true), Some(true), Some(false)], pattern: [1, 1, 3], freedom: 7 }
Descending p=0 consumed=0 freedom=7
Trying offset 0
Bit cleared in range 0..1, continuing
Trying offset 1
Descending...
Descending p=3 consumed=1 freedom=6
Trying offset 0
Bit cleared in range 3..4, continuing
Trying offset 1
Bit cleared in range 4..5, continuing
Trying offset 2
Descending...
Descending p=7 consumed=2 freedom=4
Trying offset 0
Bit cleared in range 7..10, continuing
Trying offset 1
Bit cleared in range 8..11, continuing
Trying offset 2
Bit cleared in range 9..12, continuing
Trying offset 3
Descending...
Descending p=14 consumed=3 freedom=1
no blocks remain
1 at position 11
Trying offset 4
Bit cleared in range 11..14, continuing
1 at position 6
Trying offset 3
Descending...
Descending p=8 consumed=2 freedom=3
Trying offset 0
Bit cleared in range 8..11, continuing
Trying offset 1
Bit cleared in range 9..12, continuing
Trying offset 2
Descending...
Cache hit
1 at position 11
Trying offset 3
Bit cleared in range 11..14, continuing
2 at position 7
Trying offset 4
Bit cleared in range 7..8, continuing
Trying offset 5
Bit cleared in range 8..9, continuing
Trying offset 6
Bit cleared in range 9..10, continuing
2 at position 2
Trying offset 2
Descending...
Descending p=4 consumed=1 freedom=5
Trying offset 0
Bit cleared in range 4..5, continuing
Trying offset 1
Descending...
Cache hit
1 at position 6
Trying offset 2
Descending...
Cache hit
2 at position 7
Trying offset 3
Bit cleared in range 7..8, continuing
Trying offset 4
Bit cleared in range 8..9, continuing
Trying offset 5
Bit cleared in range 9..10, continuing
4 at position 3
Trying offset 3
Bit cleared in range 3..4, continuing
Trying offset 4
Bit cleared in range 4..5, continuing
Trying offset 5
Descending...
Descending p=7 consumed=1 freedom=2
Trying offset 0
Bit cleared in range 7..8, continuing
Trying offset 1
Bit cleared in range 8..9, continuing
Trying offset 2
Bit cleared in range 9..10, continuing
4 at position 6
Trying offset 6
Descending...
Descending p=8 consumed=1 freedom=1
Trying offset 0
Bit cleared in range 8..9, continuing
Trying offset 1
Bit cleared in range 9..10, continuing
4 at position 7
Trying offset 7
Bit cleared in range 7..8, continuing
Counting solutions for RowView { bits: [None, Some(true), None, Some(true), None, Some(true), None, Some(true), None, Some(true), None, Some(true), None, Some(true), None], pattern: [1, 3, 1, 6], freedom: 1 }
Descending p=0 consumed=0 freedom=1
Trying offset 0
found blocker at 1
Trying offset 1
Descending...
Descending p=3 consumed=1 freedom=0
Trying offset 0
Descending...
Descending p=7 consumed=2 freedom=0
Trying offset 0
Descending...
Descending p=9 consumed=3 freedom=0
Trying offset 0
Descending...
Descending p=16 consumed=4 freedom=0
no blocks remain
1 at position 10
1 at position 8
1 at position 4
1 at position 2
Counting solutions for RowView { bits: [None, None, None, None, Some(false), Some(true), Some(false), Some(false), Some(false), Some(true), Some(false), Some(false), Some(false)], pattern: [4, 1, 1], freedom: 5 }
Descending p=0 consumed=0 freedom=5
Trying offset 0
Descending...
Descending p=5 consumed=1 freedom=5
Trying offset 0
Descending...
Descending p=7 consumed=2 freedom=5
Trying offset 0
Bit cleared in range 7..8, continuing
Trying offset 1
Bit cleared in range 8..9, continuing
Trying offset 2
Descending...
Descending p=11 consumed=3 freedom=3
no blocks remain
1 at position 10
Trying offset 3
Bit 9 set, giving up
1 at position 6
Trying offset 1
Bit 5 set, giving up
1 at position 1
Trying offset 1
Bit cleared in range 1..5, continuing
Trying offset 2
Bit cleared in range 2..6, continuing
Trying offset 3
Bit cleared in range 3..7, continuing
Trying offset 4
Bit cleared in range 4..8, continuing
Trying offset 5
Bit cleared in range 5..9, continuing
Counting solutions for RowView { bits: [None, None, None, None, Some(false), Some(true), Some(true), Some(true), Some(true), Some(true), Some(true), Some(false), Some(false), Some(true), Some(true), Some(true), Some(true), Some(true), Some(false)], pattern: [1, 6, 5], freedom: 5 }
Descending p=0 consumed=0 freedom=5
Trying offset 0
Descending...
Descending p=2 consumed=1 freedom=5
Trying offset 0
Bit cleared in range 2..8, continuing
Trying offset 1
Bit cleared in range 3..9, continuing
Trying offset 2
Bit cleared in range 4..10, continuing
Trying offset 3
Descending...
Descending p=12 consumed=2 freedom=2
Trying offset 0
Bit cleared in range 12..17, continuing
Trying offset 1
Descending...
Descending p=19 consumed=3 freedom=1
no blocks remain
1 at position 14
Trying offset 2
Bit 13 set, giving up
1 at position 6
Trying offset 4
Bit 5 set, giving up
1 at position 1
Trying offset 1
Descending...
Descending p=3 consumed=1 freedom=4
Trying offset 0
Bit cleared in range 3..9, continuing
Trying offset 1
Bit cleared in range 4..10, continuing
Trying offset 2
Descending...
Cache hit
1 at position 6
Trying offset 3
Bit 5 set, giving up
2 at position 2
Trying offset 2
Descending...
Descending p=4 consumed=1 freedom=3
Trying offset 0
Bit cleared in range 4..10, continuing
Trying offset 1
Descending...
Cache hit
1 at position 6
Trying offset 2
Bit 5 set, giving up
3 at position 3
Trying offset 3
Descending...
Descending p=5 consumed=1 freedom=2
Trying offset 0
Descending...
Cache hit
1 at position 6
Trying offset 1
Bit 5 set, giving up
4 at position 4
Trying offset 4
Bit cleared in range 4..5, continuing
Trying offset 5
found blocker at 6
Counting solutions for RowView { bits: [None, Some(true), Some(true), Some(true), None, None, None, None, None, None, None, None], pattern: [3, 2, 1], freedom: 4 }
Descending p=0 consumed=0 freedom=4
Trying offset 0
found blocker at 3
Trying offset 1
Descending...
Descending p=5 consumed=1 freedom=3
Trying offset 0
Descending...
Descending p=8 consumed=2 freedom=3
Trying offset 0
Descending...
Descending p=10 consumed=3 freedom=3
no blocks remain
1 at position 9
Trying offset 1
Descending...
Descending p=11 consumed=3 freedom=2
no blocks remain
2 at position 10
Trying offset 2
Descending...
Descending p=12 consumed=3 freedom=1
no blocks remain
3 at position 11
Trying offset 3
Descending...
Descending p=13 consumed=3 freedom=0
no blocks remain
4 at position 12
4 at position 6
Trying offset 1
Descending...
Descending p=9 consumed=2 freedom=2
Trying offset 0
Descending...
Cache hit
1 at position 10
Trying offset 1
Descending...
Cache hit
2 at position 11
Trying offset 2
Descending...
Cache hit
3 at position 12
7 at position 7
Trying offset 2
Descending...
Descending p=10 consumed=2 freedom=1
Trying offset 0
Descending...
Cache hit
1 at position 11
Trying offset 1
Descending...
Cache hit
2 at position 12
9 at position 8
Trying offset 3
Descending...
Descending p=11 consumed=2 freedom=0
Trying offset 0
Descending...
Cache hit
1 at position 12
10 at position 9
10 at position 2
Trying offset 2
Bit 1 set, giving up
Part 1: Total: 21