結果
問題 | No.870 無敵囲い |
ユーザー |
![]() |
提出日時 | 2019-09-10 21:08:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 300 ms |
コード長 | 712 bytes |
コンパイル時間 | 1,518 ms |
コンパイル使用メモリ | 168,720 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-29 06:24:44 |
合計ジャッジ時間 | 2,234 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define REP(i,a) for(int i = 0; i < (a); i++)#define ALL(a) (a).begin(),(a).end()typedef long long ll;typedef pair<int, int> P;const int INF = 1e9;const int MOD = 1e9 + 7;signed main(){int n;cin >> n;P a[3];a[0] = P(2, 8), a[1] = P(3, 9), a[2] = P(7, 9);int x1,y1,x2,y2;REP(i,n){cin >> x1 >> y1 >> x2 >> y2;REP(j,3){if(x1 == a[j].first && y1 == a[j].second){a[j].first = x2;a[j].second = y2;}}}if(a[0] == P(5, 8) && a[1] == P(4, 8) && a[2] == P(6, 8)){cout << "YES" << endl;}else{cout << "NO" << endl;}}