結果

問題 No.870 無敵囲い
ユーザー d_seid_sei
提出日時 2020-03-15 08:55:53
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 300 ms
コード長 1,506 bytes
コンパイル時間 748 ms
コンパイル使用メモリ 99,680 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-11 16:30:45
合計ジャッジ時間 1,624 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> IP;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)



int main() {
	int N;
	cin >> N;
	vector<IP>XY1(N);
	vector<IP>XY2(N);
	rep(i, N) {
		cin >> XY1[i].first >> XY1[i].second >> XY2[i].first >> XY2[i].second;
	}
	IP n1, n2, n3;
	n1 = make_pair(2, 8);
	n2 = make_pair(3, 9);
	n3 = make_pair(7, 9);
	rep(i, N) {
		if (n1 == XY1[i]) {
			n1 = XY2[i];
		}
		else if (n2 == XY1[i]) {
			n2 = XY2[i];
		}
		else if (n3 == XY1[i]) {
			n3 = XY2[i];
		}
	}
	IP m1, m2, m3;
	m1 = make_pair(5, 8);
	m2 = make_pair(4, 8);
	m3 = make_pair(6, 8);
	if (n1 == m1 && n2 == m2 && n3 == m3) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}
0