結果
問題 | No.870 無敵囲い |
ユーザー |
|
提出日時 | 2022-10-19 12:13:17 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 300 ms |
コード長 | 998 bytes |
コンパイル時間 | 269 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-29 15:14:53 |
合計ジャッジ時間 | 1,586 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
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()