Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Last active January 24, 2016 01:53
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/edc1985b7a5f12d91f68 to your computer and use it in GitHub Desktop.
Save whatalnk/edc1985b7a5f12d91f68 to your computer and use it in GitHub Desktop.
第二回 ドワンゴからの挑戦状 予選
n = gets.chomp.to_i
puts n / 25
n = gets.chomp.to_i
k = gets.chomp.split(" ").map(&:to_i)
res = []
(n - 2).times do |i|
res << [k[i], k[i + 1]].min
end
res.unshift(k.first)
res.push(k.last)
puts res.join(" ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment