Skip to main content

miller_rabin

Function miller_rabin 

Source
pub fn miller_rabin(n: u64) -> bool
Examples found in repository?
crates/library_checker/src/number_theory/primality_test.rs (line 12)
6pub fn primality_test(reader: impl Read, mut writer: impl Write) {
7    let s = read_all_unchecked(reader);
8    let mut scanner = Scanner::new(&s);
9    scan!(scanner, q);
10    for _ in 0..q {
11        scan!(scanner, n: u64);
12        let ans = if miller_rabin(n) { "Yes" } else { "No" };
13        writeln!(writer, "{}", ans).ok();
14    }
15}