問題URL
$m\mod a_i$ の上界は $a_i - 1$
$m = a_1 \times a_2$ $\times ... \times$ $a_n - 1$ とすればこの値は $m\mod a_i$ の上界と一致する
よって、答えは $a_1 + a_2$ $+ ... +$ $a_N - N$ となる
More than 5 years have passed since last update.
ABC103-C Modulo Summation
Last updated at Posted at 2018-07-21
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
00