結果

問題 No.870 無敵囲い
ユーザー face4face4
提出日時 2019-08-30 21:24:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 300 ms
コード長 666 bytes
コンパイル時間 497 ms
コンパイル使用メモリ 65,344 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-11 16:06:21
合計ジャッジ時間 1,347 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
    pair<int,int> p[3], q[3];
    p[0] = {2, 8};  q[0] = {5, 8};
    p[1] = {3, 9};  q[1] = {4, 8};
    p[2] = {7, 9};  q[2] = {6, 8};
    while(n-- > 0){
        int x, y, tx, ty;
        cin >> x >> y >> tx >> ty;
        for(int i = 0; i < 3; i++){
            if(p[i].first == x && p[i].second == y){
                p[i].first = tx, p[i].second = ty;
                break;
            }
        }
    }
    bool valid = true;
    for(int i = 0; i < 3; i++)  valid &= (p[i].first == q[i].first && p[i].second==q[i].second);
    cout << (valid ? "YES" : "NO") << endl;
    return 0;
}
0