[Rust/2022/17] Fix compiler error
This commit is contained in:
parent
04d2dbc802
commit
20103cb0cc
1 changed files with 4 additions and 3 deletions
|
@ -178,9 +178,10 @@ fn part2(input: &Input) -> u64 {
|
|||
let l = n - i - 1;
|
||||
if n >= l * 2 && steps[n - l..] == steps[n - 2 * l..n - l] {
|
||||
let left = 1000000000000 - round;
|
||||
height +=
|
||||
(left / l) as u64 * (steps[n - 1].height - steps[n - l - 1].height);
|
||||
height += steps[n - l - 1 + left % l].height - steps[n - l - 1].height;
|
||||
let s: &Step = &steps[n - l - 1];
|
||||
let t: &Step = &steps[n - l - 1 + left % l];
|
||||
height += (left / l) as u64 * (steps[n - 1].height - s.height);
|
||||
height += t.height - s.height;
|
||||
return Some(height);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue