Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AtCoder ABC #123 A - Five Antennas
pos = []
5.times do
pos << gets.chomp.to_i
end
k = gets.chomp.to_i
pos.combination(2) do |a, b|
if (a - b).abs > k
puts ":("
exit
end
end
puts "Yay!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.