結果
| 問題 | No.870 無敵囲い | 
| コンテスト | |
| ユーザー |  cumin | 
| 提出日時 | 2020-03-27 09:15:49 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 300 ms | 
| コード長 | 495 bytes | 
| コンパイル時間 | 1,448 ms | 
| コンパイル使用メモリ | 166,312 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-29 06:38:44 | 
| 合計ジャッジ時間 | 1,915 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
const ll INF=1e18;
const int MOD=1e9+7;
const double pi=acos(-1);
int main(){
  int n;
  cin >> n;
  int f[10][10]={};
  f[2][8]=1;
  f[3][9]=2;
  f[7][9]=3;
  rep(i,n){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    f[c][d]=f[a][b];
    f[a][b]=0;
  }
  if(f[5][8]==1 && f[4][8]==2 && f[6][8]==3)cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
  
}
            
            
            
        