LoginSignup
0
0

More than 5 years have passed since last update.

atcoder ABC112 D問題

Last updated at Posted at 2019-01-03

今回は問題は数学的な問題であり、気づきがないと一生終わらない問題だった。
https://atcoder.jp/contests/abc112/tasks/abc112_d

方針

数値Mについて、N個の数字の和で表し、その最大公約数を求める問題である。まずある数iについて考えると、これがMをN個の数字の和で表せ、その公約数となるなら、Mはiで割り切れなければならない。また、i*N<=Mも満たさなければならない。以上を踏まえ、iをM/Nからはじめ1までforで回し、条件に合うのを探せば良い。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0