結果

問題 No.1366 交換門松列・梅
ユーザー nanamenaname
提出日時 2021-01-29 21:30:34
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 1,292 bytes
コンパイル時間 1,816 ms
コンパイル使用メモリ 164,872 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 10:27:26
合計ジャッジ時間 2,507 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)      //iをaからn
#define per(i, n, a) for (int i = a - 1; i >= n; i--) //iをnからa
#define db(x) cout << #x << " = " << x << endl
#define db2(x, y) cout << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n"; //デバッグ用
#define all(x) (x).begin(), (x).end()
//sort(all(a)); ソート
//sort(all(a),greater<int>()); 逆順ソート
bool isKado(int a,int b,int c){
    if(a==c){
        return false;
    }else if(a<b&&b>c){
        return true;
    }else if(a>b&&b<c){
        return true;
    }else{
        return false;
    }
}

int main()
{
    vector<int> a(3),b(3);
    vector<int> aa(3),bb(3);
    int aaa;
    rep(i,0,3){
        cin>>aaa;
        a.at(i)=aaa;
    }
    rep(i,0,3){
        cin>>aaa;
        b.at(i)=aaa;
    }

    rep(i,0,3){
        rep(j,0,3){
        aa.at(0)=a.at(0);
        aa.at(1)=a.at(1);
        aa.at(2)=a.at(2);
        bb.at(0)=b.at(0);
        bb.at(1)=b.at(1);
        bb.at(2)=b.at(2);
        
        aa.at(i)=b.at(j);
        bb.at(j)=a.at(i);
        if(isKado(aa.at(0),aa.at(1),aa.at(2))&&isKado(bb.at(0),bb.at(1),bb.at(2))){
            cout<<"Yes";
            return 0;
        }
        }
    }

    cout<<"No";
return 0;
}
0