結果

問題 No.870 無敵囲い
コンテスト
ユーザー pro_kuni
提出日時 2019-09-14 19:25:22
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 300 ms
コード長 893 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 412 ms
コンパイル使用メモリ 76,240 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-18 16:26:40
合計ジャッジ時間 1,049 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

struct Coord {
    int x, y;
};

int main() {
    int n;
    std::cin >> n;
    struct Coord a;
    a.x = 2;
    a.y = 8;
    struct Coord b;
    b.x = 3;
    b.y = 9;
    struct Coord c;
    c.x = 7;
    c.y = 9;

    for (int i = 0; i < n; i++) {
        int x1, y1, x2, y2;
        std::cin >> x1 >> y1 >> x2 >> y2;
        struct Coord *focus;
        if (a.x == x1 && a.y == y1) focus = &a;
        else if (b.x == x1 && b.y == y1) focus = &b;
        else if (c.x == x1 && c.y == y1) focus = &c;
        else continue;
        focus->x = x2;
        focus->y = y2;
    }

    if (a.x == 5 && a.y == 8 &&
        b.x == 4 && b.y == 8 &&
        c.x == 6 && c.y == 8) {
        std::cout << "YES" << std::endl;
    } else {
        std::cout << "NO" << std::endl;
    }


    return 0;
}

0