algo — C++23 日本語リファレンス GitHub

sqrt_mod

関数 · 素数法上で x の平方根を 1 つ返す

template <internal::modint mint>
std::optional<mint> sqrt_mod(mint x);

概要

素数法上で x の平方根を 1 つ返す

戻り値

平方根が存在しなければ std::nullopt

計算量

関連項目