TPK algorithm: Difference between revisions

Content deleted Content added
Ricvelozo (talk | contribs)
Ricvelozo (talk | contribs)
Line 107:
use std::{io, iter::zip};
 
fn f(t: f64) -> Option<f64> {
let y = t.abs().sqrt() + 5.0 * t.powi(3);
(y <= 400.0).then_some(y)
}
 
Line 118 ⟶ 119:
 
a.iter().enumerate().rev().for_each(|(i, &t)| match f(t) {
y if y > 400.0None => println!("{i} TOO LARGE"),
Some(y) => println!("{i} {y}"),
});
}