結果
| 問題 | No.870 無敵囲い | 
| コンテスト | |
| ユーザー |  sorag | 
| 提出日時 | 2022-08-05 23:37:04 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 300 ms | 
| コード長 | 607 bytes | 
| コンパイル時間 | 649 ms | 
| コンパイル使用メモリ | 74,912 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-09-15 21:26:23 | 
| 合計ジャッジ時間 | 1,368 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#define all(x) x.begin(),x.end()
#define pb push_back
#define ll long long 
#define P pair<int,int>
#define LP pair<ll,ll>
using namespace std;
int main() {
	ll n;
	cin >> n;
	P a = P(2, 8), b = P(3, 9), c = P(7, 9);
	for (int i = 0; i < n; i++) {
		P f, g;
		cin >> f.first >> f.second >> g.first >> g.second;
		if (a == f) a = g;
		else if (b == f) b = g;
		else if (c == f) c = g;
	}
	if (a == P(5, 8) and b == P(4, 8) and c == P(6, 8)) {
		cout << "YES" << endl;
	}
	else cout << "NO" << endl;
	
	return 0;
}
            
            
            
        