結果
問題 | No.870 無敵囲い |
ユーザー |
|
提出日時 | 2019-08-31 09:38:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 300 ms |
コード長 | 627 bytes |
コンパイル時間 | 2,281 ms |
コンパイル使用メモリ | 193,268 KB |
最終ジャッジ日時 | 2025-01-07 16:08:23 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; pair<int, int> pos[3] = {{2, 8}, {3, 9}, {7, 9}}; for (int i = 0; i < n; i++) { pair<int, int> from, to; cin >> from.first >> from.second; cin >> to.first >> to.second; for (int j = 0; j < 3; j++) { if (pos[j] == from) { pos[j] = to; break; } } } if (pos[0] == make_pair(5, 8) && pos[1] == make_pair(4, 8) && pos[2] == make_pair(6, 8)) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }