Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created April 6, 2019 14:07
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/0d15a0563f4b76668c3355a4861b1347 to your computer and use it in GitHub Desktop.
Save whatalnk/0d15a0563f4b76668c3355a4861b1347 to your computer and use it in GitHub Desktop.
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