diff options
author | pommicket <pommicket@gmail.com> | 2024-09-06 00:17:17 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2024-09-06 00:17:17 -0400 |
commit | 4ce728c5d48d42946de5637a46071ea262d8504a (patch) | |
tree | c66d5cc64e27979c5fcaec7af9d916cb598f1052 /src/main.rs | |
parent | 12d918322e187f517105366434b8c0a791895aa0 (diff) |
fmt
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs index c14ee2a..5f3a3b5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -46,9 +46,14 @@ fn main() { range = i; } } - if range <= 4 { break; } + if range <= 4 { + break; + } } - println!("memory needed = {}MiB", (numbers.len() * size_of::<UInt>()) >> 20); + println!( + "memory needed = {}MiB", + (numbers.len() * size_of::<UInt>()) >> 20 + ); numbers.sort(); let mut prev = UInt::from(0u8); let mut occurrences = 0; @@ -56,9 +61,15 @@ fn main() { if n == prev { occurrences += 1; } else if occurrences > 0 { - if is_choose_r(prev, 2) { occurrences += 1; } - if is_choose_r(prev, 3) { occurrences += 1; } - if is_choose_r(prev, 4) { occurrences += 1; } + if is_choose_r(prev, 2) { + occurrences += 1; + } + if is_choose_r(prev, 3) { + occurrences += 1; + } + if is_choose_r(prev, 4) { + occurrences += 1; + } if occurrences > 1 { println!("{prev}: {occurrences}"); } @@ -78,7 +89,8 @@ fn sufficiently_small() { (r..10000) .filter(|&x| { 2 * x - r + 1 - != (((x - r + 1..=x).map(|x| x as f64).product::<f64>()).powf(1.0 / r as f64) * 2.0) + != (((x - r + 1..=x).map(|x| x as f64).product::<f64>()) + .powf(1.0 / r as f64) * 2.0) .ceil() as u128 }) .max() |