Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created February 19, 2018 01:40
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/89d27ff18c4914c125e3fd7f3205ed37 to your computer and use it in GitHub Desktop.
Save whatalnk/89d27ff18c4914c125e3fd7f3205ed37 to your computer and use it in GitHub Desktop.
AtCoder ABC #088 C. Takahashi's Information
c = []
csum0 = 0
3.times do
row = gets.chomp.split(" ").map(&:to_i)
csum0 += row.inject(:+)
c << row
end
csum1 = c[0][0] + c[1][1] + c[2][2]
csum2 = c[0][2] + c[1][1] + c[2][0]
if csum0 == csum1 * 3 && csum0 == csum2 * 3 then
puts "Yes"
else
puts "No"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment