結果

問題 No.870 無敵囲い
ユーザー kebabubu364kebabubu364
提出日時 2019-10-01 17:59:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 300 ms
コード長 1,326 bytes
コンパイル時間 780 ms
コンパイル使用メモリ 96,412 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-11 16:18:17
合計ジャッジ時間 1,759 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 50;

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
using namespace std;

void solve(){
	int n;
    cin>>n;
    pair<int,int>a=make_pair(2,8),b=make_pair(3,9),c=make_pair(7,9);
    vector<pair<int,int>>cd1(n),cd2(n);
    rep(i,n){
        int x1,y1,x2,y2;
        cin>>x1>>y1>>x2>>y2;
        cd1[i]=make_pair(x1,y1);cd2[i]=make_pair(x2,y2);
    }
    rep(i,n){
        if(cd1[i]==a)a=cd2[i];
        else if(cd1[i]==b)b=cd2[i];
        else if(cd1[i]==c)c=cd2[i];
    }
    if(a.first==5&&a.second==8&&b.first==4&&b.second==8&&c.first==6&&c.second==8)cout<<"YES\n";
    else cout<<"NO\n";
}

signed main(){
	std::ios::sync_with_stdio(false);
    std::cin.tie(0);
	solve();
	return 0;
}
0