pub type DynMIntU32 = MInt<DynModuloU32>;Aliased Type§
#[repr(transparent)]pub struct DynMIntU32 {
x: u32,
_marker: PhantomData<fn() -> DynModuloU32>,
}Fields§
§x: u32§_marker: PhantomData<fn() -> DynModuloU32>Implementations§
Source§impl DynMIntU32
impl DynMIntU32
Sourcepub fn set_mod(m: u32)
pub fn set_mod(m: u32)
Examples found in repository?
crates/library_checker/src/number_theory/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}