結果
| 問題 | No.870 無敵囲い | 
| コンテスト | |
| ユーザー |  pro_kuni | 
| 提出日時 | 2019-09-14 19:25:22 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 300 ms | 
| コード長 | 893 bytes | 
| コンパイル時間 | 718 ms | 
| コンパイル使用メモリ | 59,100 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-29 06:24:41 | 
| 合計ジャッジ時間 | 1,134 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
#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;
}
            
            
            
        