結果

問題 No.1366 交換門松列・梅
コンテスト
ユーザー shu8Cream
提出日時 2021-01-29 21:35:38
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 1,010 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,287 ms
コンパイル使用メモリ 215,024 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-06-17 10:52:05
合計ジャッジ時間 2,161 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 WA * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:24:10: warning: ignoring return value of 'bool std::operator==(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = allocator<int>]', declared with attribute 'nodiscard' [-Wunused-result]
   24 |         a==aa; b=bb;
      |         ~^~~~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/vector:68,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/functional:66,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/x86_64-pc-linux-gnu/bits/stdc++.h:55,
                 from main.cpp:6:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_vector.h:2338:5: note: declared here
 2338 |     operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
      |     ^~~~~~~~

ソースコード

diff #
raw source code

/**
*    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){
        a==aa; b=bb;
        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