Last active
January 24, 2016 01:53
-
-
Save whatalnk/edc1985b7a5f12d91f68 to your computer and use it in GitHub Desktop.
第二回 ドワンゴからの挑戦状 予選
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 | |
puts n / 25 |
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 | |
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