mirror of
https://github.com/RussellChamp/advent-of-code-2024-rust.git
synced 2026-10-27 23:52:29 +00:00
remove diagnostics update benchmarks
This commit is contained in:
1 parent
680c9547e4
commit
54c5667958
2 files changed
+8
-8
No files matched your search
@@ -41,9 +41,9 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www.
|
||||
| [Day 10](./src/bin/10.rs) | `10.1ms` | `-` |
|
||||
| [Day 11](./src/bin/11.rs) | `1.9s` | `-` |
|
||||
| [Day 12](./src/bin/12.rs) | `4.5ms` | `-` |
|
||||
| [Day 13](./src/bin/13.rs) | `3.1ms` | `-` |
|
||||
| [Day 13](./src/bin/13.rs) | `2.7ms` | `719.8µs` |
|
||||
|
||||
**Total: 1980.39ms**
|
||||
**Total: 1980.71ms**
|
||||
<!--- benchmarking table --->
|
||||
|
||||
---
|
||||
|
||||
+6
-6
@@ -69,7 +69,7 @@ pub fn part_two(input: &str) -> Option<u64> {
|
||||
Machine { a_button, b_button, prize }
|
||||
}).collect_vec();
|
||||
|
||||
println!("PROCESSING {} MACHINES", machines.len());
|
||||
// println!("PROCESSING {} MACHINES", machines.len());
|
||||
let wins = machines.iter().filter_map(|Machine { a_button, b_button, prize }| {
|
||||
|
||||
let denom = (a_button.x * b_button.y) - (a_button.y * b_button.x );
|
||||
@@ -77,23 +77,23 @@ pub fn part_two(input: &str) -> Option<u64> {
|
||||
let b_numer = (prize.y * a_button.x) - (prize.x * a_button.y);
|
||||
|
||||
if a_numer % denom != 0 || b_numer % denom != 0 {
|
||||
print!("❌");
|
||||
// print!("❌");
|
||||
return None;
|
||||
}
|
||||
|
||||
let a_presses = a_numer / denom;
|
||||
let b_presses = b_numer / denom;
|
||||
|
||||
print!("✔️ ");
|
||||
// print!("✔️ ");
|
||||
Some(3 * a_presses + b_presses)
|
||||
// println!("MATCHES {:?}", matches);
|
||||
}).collect_vec();
|
||||
|
||||
println!();
|
||||
println!("WON {} PRIZES!", wins.len());
|
||||
// println!();
|
||||
// println!("WON {} PRIZES!", wins.len());
|
||||
|
||||
let total_tokens: isize = wins.into_iter().sum();
|
||||
println!("COST {} TOKENS!", total_tokens);
|
||||
// println!("COST {} TOKENS!", total_tokens);
|
||||
Some(total_tokens as u64)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user