結果
| 問題 | No.870 無敵囲い | 
| コンテスト | |
| ユーザー |  a01sa01to | 
| 提出日時 | 2023-11-13 00:45:37 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 300 ms | 
| コード長 | 741 bytes | 
| コンパイル時間 | 1,688 ms | 
| コンパイル使用メモリ | 192,912 KB | 
| 最終ジャッジ日時 | 2025-02-17 21:49:31 | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
  #include "settings/debug.cpp"
  #define _GLIBCXX_DEBUG
#else
  #define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;
int main() {
  int n;
  cin >> n;
  pair<int, int> a = { 2, 8 }, b = { 3, 9 }, c = { 7, 9 };
  while (n--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (a == make_pair(x1, y1)) a = { x2, y2 };
    if (b == make_pair(x1, y1)) b = { x2, y2 };
    if (c == make_pair(x1, y1)) c = { x2, y2 };
  }
  bool ok = true;
  ok &= (a == make_pair(5, 8));
  ok &= (b == make_pair(4, 8));
  ok &= (c == make_pair(6, 8));
  cout << (ok ? "YES" : "NO") << endl;
  return 0;
}
            
            
            
        