Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created April 11, 2017 14:12
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/8ce84eedf520387364d24e7801dbadbd to your computer and use it in GitHub Desktop.
Save whatalnk/8ce84eedf520387364d24e7801dbadbd to your computer and use it in GitHub Desktop.
AtCoder AGC #012
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