Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created April 18, 2019 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/8110efd0778d083105234bc02617da84 to your computer and use it in GitHub Desktop.
Save whatalnk/8110efd0778d083105234bc02617da84 to your computer and use it in GitHub Desktop.
AtCoder ABC #118 C - Monsters Battle Royale
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