結果

問題 No.1366 交換門松列・梅
ユーザー shu8Creamshu8Cream
提出日時 2021-01-29 21:51:00
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,047 bytes
コンパイル時間 2,162 ms
コンパイル使用メモリ 197,932 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 10:30:04
合計ジャッジ時間 2,755 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
*    author:  shu8Cream
*    created: 29.01.2021 20:56:09
**/

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    vi a(3), b(3);
    rep(i,3) cin >> a[i];
    rep(i,3) cin >> b[i];
    vi aa(3), bb(3);
    aa=a; bb=b;
    rep(i,3)rep(j,3){
        rep(k,3) a[k]=aa[k];
        rep(k,3) b[k]=bb[k];
        swap(a[i],b[j]);
        if(a[0]==a[1] || a[1]==a[2] || a[2]==a[0]) continue;
        if(b[0]==b[1] || b[1]==b[2] || b[2]==b[0]) continue;
        int amx=max({a[0],a[1],a[2]});
        int amn=min({a[0],a[1],a[2]});
        int bmx=max({b[0],b[1],b[2]});
        int bmn=min({b[0],b[1],b[2]});
        if(a[1]==amx || a[1]==amn){
            if(b[1]==bmx || b[1]==bmn){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}
0