Created
April 18, 2019 11:13
-
-
Save whatalnk/8110efd0778d083105234bc02617da84 to your computer and use it in GitHub Desktop.
AtCoder ABC #118 C - Monsters Battle Royale
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = gets.chomp.to_i | |
a = gets.chomp.split(" ").map(&:to_i) | |
ret = a[0].gcd(a[1]) | |
a.each do |x| | |
ret = ret.gcd(x) | |
end | |
puts ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment