結果
| 問題 |
No.870 無敵囲い
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-19 20:20:49 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 300 ms |
| コード長 | 1,210 bytes |
| コンパイル時間 | 760 ms |
| コンパイル使用メモリ | 94,360 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-29 06:45:16 |
| 合計ジャッジ時間 | 1,279 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
#define _USE_MATH_DEFINES
#include <iostream> //cin, cout
#include <vector> //vector
#include <algorithm> //sort,min,max,count
#include <string> //string,getline, to_string
#include <ios> //fixed
#include <iomanip> //setprecision
#include <utility> //swap, pair
#include <cstdlib> //abs(int)
#include <cmath> //sqrt,ceil,M_PI, pow, sin
#include <sstream> //stringstream,getline
#include <numeric> //gcd, accumlate
#include <deque> //deque
#include <random> //randam_device
#include <limits> //numeric_limits
using namespace std;
constexpr long long int D_MOD = 1000000007;
int main() {
pair<int, int> A, B, C;
A.first = 2; A.second = 8;
B.first = 3; B.second = 9;
C.first = 7; C.second = 9;
int N;
cin >> N;
int a, b, c, d;
for (int i = 0; i < N; i++) {
cin >> a >> b >> c >> d;
if (A.first == a && A.second == b) { A.first = c; A.second = d; }
if (B.first == a && B.second == b) { B.first = c; B.second = d; }
if (C.first == a && C.second == b) { C.first = c; C.second = d; }
}
if (A.first == 5 && A.second == 8) {
if (B.first == 4 && B.second == 8) {
if (C.first == 6 && C.second == 8) {
cout << "YES" << endl;
return 0;
}
}
}
cout << "NO" << endl;
return 0;
}