結果
| 問題 | No.870 無敵囲い | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-12-15 18:50:11 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 300 ms | 
| コード長 | 504 bytes | 
| コンパイル時間 | 1,605 ms | 
| コンパイル使用メモリ | 170,188 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-29 06:46:34 | 
| 合計ジャッジ時間 | 2,340 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<vector<int>> grid(10, vector<int>(10, 0));
  grid[2][8] = 1;
  grid[3][9] = 2;
  grid[7][9] = 3;
  for (int i = 0; i < N; i++) {
    int x, y, z, w;
    cin >> x >> y >> z >> w;
    if (grid[x][y] > 0) {
      grid[z][w] = grid[x][y];
      grid[x][y] = 0;
    }
  }
  if (grid[5][8] == 1 && grid[4][8] == 2 && grid[6][8] == 3) {
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }
  return 0;
}
            
            
            
        