Created
February 19, 2018 01:40
-
-
Save whatalnk/89d27ff18c4914c125e3fd7f3205ed37 to your computer and use it in GitHub Desktop.
AtCoder ABC #088 C. Takahashi's Information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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