Skip to content

Instantly share code, notes, and snippets.

@spin-glass
Created December 26, 2016 04:02
Show Gist options
  • Save spin-glass/b6cdcfd591b4f20e8ed46155f33725c3 to your computer and use it in GitHub Desktop.
Save spin-glass/b6cdcfd591b4f20e8ed46155f33725c3 to your computer and use it in GitHub Desktop.
N = gets.to_i
nums = gets.split.map(&:to_i)
cnt = 0;
nums.each_with_index{|num, i|
nums_dup = nums.dup #浅いコピー
nums_dup.delete_at(i)
cnt += 1 if nums_dup.find{|n| n + num == 256}
}
puts cnt > 0 ? "yes" : "no"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment