結果
| 問題 | No.870 無敵囲い | 
| コンテスト | |
| ユーザー |  lumc_ | 
| 提出日時 | 2019-08-30 21:23:24 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 300 ms | 
| コード長 | 991 bytes | 
| コンパイル時間 | 731 ms | 
| コンパイル使用メモリ | 101,340 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-29 06:12:09 | 
| 合計ジャッジ時間 | 1,339 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
// includes {{{
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<random>
#include<cassert>
#include<bitset>
#include<cstdlib>
// #include<deque>
// #include<multiset>
// #include<cstring>
// #include<bits/stdc++.h>
// }}}
using namespace std;
using ll = long long;
int f[100][100];
#define POS(x) cout<<((x)?"POSSIBLE":"IMPOSSIBLE")<<endl;
#define Pos(x) cout<<((x)?"Possible":"Impossible")<<endl;
#define YES(x) cout<<((x)?"YES":"NO")<<endl;
#define Yes(x) cout<<((x)?"Yes":"No")<<endl;
#define yes(x) cout<<((x)?"yes":"no")<<endl;
int main() {
  std::ios::sync_with_stdio(false), std::cin.tie(0);
  int n;
  cin >> n;
  f[2][8] = 1;
  f[3][9] = 2;
  f[7][9] = 3;
  
  for(int i = 0; i < n; i++) {
    int x,y,z,w;
    cin >> x >> y >> z >> w;
    f[z][w] = f[x][y];
    f[x][y] = 0;
  }
  YES(1 == f[5][8] and 2 == f[4][8] and 3 == f[6][8]);
  return 0;
}
            
            
            
        