結果

問題 No.1366 交換門松列・梅
ユーザー Kome_soudouKome_soudou
提出日時 2021-11-03 16:54:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 869 bytes
コンパイル時間 657 ms
コンパイル使用メモリ 70,160 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-21 08:20:06
合計ジャッジ時間 1,287 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

int main()
{
  vector<int> C(6);
  for(int i = 0; i < 6; i++) cin >> C.at(i);
  
  for(int i = 0; i <= 2; i++)
  {
    for(int j = 3; j <= 5; j++)
    {
      swap(C.at(i), C.at(j));
      if((C.at(0) == C.at(1)) || (C.at(1) == C.at(2)))
      {
        swap(C.at(i), C.at(j));
        continue;
      }
      if((C.at(3) == C.at(4)) || (C.at(4) == C.at(5)))
      {
        swap(C.at(i), C.at(j));
        continue;
      }
      
      if(((C.at(0) < C.at(1)) && (C.at(1) > C.at(2))) || ((C.at(0) > C.at(1)) && (C.at(1) < C.at(2))))
      {
        if(((C.at(3) < C.at(4)) && (C.at(4) > C.at(5))) || ((C.at(3) > C.at(4)) && (C.at(4) < C.at(5))))
        {
          cout << "Yes" << endl;
          return 0;
        }
      }
      swap(C.at(i), C.at(j));
    }
  }
  
  cout << "No" << endl;
  return 0;
}
0