From 1ede0e5e69ab329038754224bd169f142c210977 Mon Sep 17 00:00:00 2001 From: Viacheslav Slinko Date: Fri, 20 Dec 2024 19:07:08 +0300 Subject: [PATCH] day20 --- src/day20.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/day20.rs b/src/day20.rs index 6090751..c7efad0 100644 --- a/src/day20.rs +++ b/src/day20.rs @@ -30,7 +30,7 @@ unsafe fn calc_distances(grid: &[u8], pos: usize, dist: usize, distances: &mut [ } fn distance(x1: usize, y1: usize, x2: usize, y2: usize) -> usize { - (x1.max(x2) - x1.min(x2)) + (y1.max(y2) - y1.min(y2)) + (x1 as isize - x2 as isize).abs() as usize + (y1 as isize - y2 as isize).abs() as usize } unsafe fn solve(input: &str, max_cheating_time: usize) -> usize {