2020-03-01から1ヶ月間の記事一覧

Atcoder Regular Contest 042 D - あまり

MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']], displayMath: [ ['$$','$$'], ["\\[","\\]"] ] } }); 問題概要 4整数 X, P, A, B が与えられる.P は素数.$1\leq X < P < 2^{31}$, $0 \leq A \leq B < 2^{31}$. $X^i \,\%\, P$ …

boostの多倍長計算

AtCoderでは C++ で boost が使えるので,多倍長計算をすることができます. ヘッダ部分 先頭付近に次のように書いておきます.(競技プログラミングなので,これで良いことにしてください.) #include <boost/multiprecision/cpp_int.hpp> // 整数を使う時 #include <boost/multiprecision/cpp_bin_float.hpp> // 実数を使う時 using nam</boost/multiprecision/cpp_bin_float.hpp></boost/multiprecision/cpp_int.hpp>…