結果

問題 No.870 無敵囲い
ユーザー finefine
提出日時 2019-08-30 21:31:30
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 300 ms
コード長 828 bytes
コンパイル時間 1,400 ms
コンパイル使用メモリ 164,680 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-11 16:08:52
合計ジャッジ時間 2,384 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using P = pair<int, int>;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;

    int xx1 = 2, yy1 = 8, xx2 = 3, yy2 = 9, xx3 = 7, yy3 = 9;

    int hoge = 0;
    for (int i = 0; i < n; i++) {
        int x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        if (x1 == xx1 && y1 == yy1) {
            xx1 = x2;
            yy1 = y2;
        } else if (x1 == xx2 && y1 == yy2) {
            xx2 = x2;
            yy2 = y2;
        } else if (x1 == xx3 && y1 == yy3) {
            xx3 = x2;
            yy3 = y2;
        }
    }

    if (xx1 == 5 && yy1 == 8) hoge |= 1;
    if (xx2 == 4 && yy2 == 8) hoge |= 2;
    if (xx3 == 6 && yy3 == 8) hoge |= 4;
    cout << (hoge == 7 ? "YES" : "NO") << endl;
    return 0;
}
0