1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ABC88 C - Takahashi's Information を解いた

Posted at

abc88_1.png
abc88_2.png
abc88_3.png

ね、眠い。
とりあえず、for 文が面倒だったから、力技。

TakahashiSinformation.py
C = [list(map(int,input().split())) for _ in range(3)]
#print(C)

if C[0][1]-C[0][0] == C[1][1]-C[1][0] == C[2][1]-C[2][0]:
    if C[0][2]-C[0][1] == C[1][2]-C[1][1] == C[2][2]-C[2][1]:

        if C[1][0]-C[0][0] == C[1][1]-C[0][1] == C[1][2]-C[0][2]:
            if C[2][0]-C[1][0] == C[2][1]-C[1][1] == C[2][2]-C[1][2]:
                print("Yes")
                exit()
print("No")

問題にあるように素直に、全部試して OK なら Yes, ダメなら No

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?