結果

問題 No.870 無敵囲い
ユーザー ThetaTheta
提出日時 2022-10-19 12:13:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 300 ms
コード長 998 bytes
コンパイル時間 558 ms
コンパイル使用メモリ 10,804 KB
実行使用メモリ 7,932 KB
最終ジャッジ日時 2023-09-12 02:07:14
合計ジャッジ時間 2,163 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,872 KB
testcase_01 AC 16 ms
7,816 KB
testcase_02 AC 17 ms
7,792 KB
testcase_03 AC 16 ms
7,700 KB
testcase_04 AC 16 ms
7,776 KB
testcase_05 AC 16 ms
7,776 KB
testcase_06 AC 16 ms
7,780 KB
testcase_07 AC 16 ms
7,812 KB
testcase_08 AC 16 ms
7,868 KB
testcase_09 AC 16 ms
7,872 KB
testcase_10 AC 16 ms
7,796 KB
testcase_11 AC 16 ms
7,828 KB
testcase_12 AC 16 ms
7,764 KB
testcase_13 AC 16 ms
7,800 KB
testcase_14 AC 17 ms
7,780 KB
testcase_15 AC 16 ms
7,780 KB
testcase_16 AC 16 ms
7,776 KB
testcase_17 AC 16 ms
7,932 KB
testcase_18 AC 16 ms
7,760 KB
testcase_19 AC 16 ms
7,804 KB
testcase_20 AC 16 ms
7,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


class Point:
    def __init__(self, column, row) -> None:
        self.column = column
        self.row = row

    def __eq__(self, __o: object) -> bool:
        return self.column == __o.column and self.row == __o.row

    def __ne__(self, __o: object) -> bool:
        return not self.__eq__(__o)


def main():
    N = int(input())
    hisha = Point(2, 8)
    right_gin = Point(3, 9)
    left_gin = Point(7, 9)

    for _ in range(N):
        before_c, before_r, after_c, after_r = map(int, input().split())
        before_point = Point(before_c, before_r)
        after_point = Point(after_c, after_r)

        if before_point == hisha:
            hisha = after_point
        if before_point == left_gin:
            left_gin = after_point
        if before_point == right_gin:
            right_gin = after_point

    if hisha == Point(5, 8) and left_gin == Point(6, 8) and right_gin == Point(4, 8):
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    main()
0