Type Alias DynMIntU32

Source
pub type DynMIntU32 = MInt<DynModuloU32>;

Aliased Type§

pub struct DynMIntU32 { /* private fields */ }

Implementations§

Source§

impl DynMIntU32

Source

pub fn set_mod(m: u32)

Examples found in repository?
crates/library_checker/src/math/sqrt_mod.rs (line 11)
6pub fn sqrt_mod(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, yp: [(u32, u32)]);
10    for (y, p) in yp.take(q) {
11        DynMIntU32::set_mod(p);
12        if let Some(x) = DynMIntU32::from(y).sqrt() {
13            writeln!(writer, "{}", x).ok();
14        } else {
15            writeln!(writer, "-1").ok();
16        }
17    }
18}