Created
April 11, 2017 14:12
-
-
Save whatalnk/8ce84eedf520387364d24e7801dbadbd to your computer and use it in GitHub Desktop.
AtCoder AGC #012
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).sort | |
ret = 0 | |
(3 * n - 2).step(n, -2) do |i| | |
ret += a[i] | |
end | |
puts ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment