mirror of
https://github.com/Noratrieb/advent-of-code.git
synced 2026-01-16 02:25:02 +01:00
part 1
This commit is contained in:
parent
f4dbebba6b
commit
314ef2ca61
8 changed files with 132 additions and 3 deletions
|
|
@ -307,12 +307,9 @@ fn part2_assume_len(input_str: &str) -> u64 {
|
|||
}
|
||||
|
||||
fn part2_simd(input_str: &str) -> u64 {
|
||||
const DIGIT_LEN: usize = 5;
|
||||
let input = input_str.as_bytes();
|
||||
assert_eq!(input.last(), Some(&b'\n'));
|
||||
|
||||
const BIGGEST_ELEMENT: usize = 100_000;
|
||||
|
||||
let digit_len = input.iter().position(|b| *b == b' ').unwrap();
|
||||
|
||||
if digit_len != 5 {
|
||||
|
|
@ -331,6 +328,9 @@ fn part2_simd(input_str: &str) -> u64 {
|
|||
}
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub fn do_sse41(input: &[u8]) -> u64 {
|
||||
const DIGIT_LEN: usize = 5;
|
||||
const BIGGEST_ELEMENT: usize = 100_000;
|
||||
|
||||
let mut right_map = vec![0_u16; BIGGEST_ELEMENT];
|
||||
let mut left = Vec::<u32>::with_capacity(input.len());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue