結果

問題 No.360 増加門松列
ユーザー a
提出日時 2016-07-09 03:08:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 465 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 44,868 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-13 08:03:38
合計ジャッジ時間 1,206 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <algorithm>

using namespace std;

int d[7];

int main(void) {
  for (int i = 0; i < 7; i++) {
    scanf("%d", d+i);
  }
  sort(d, d+7);
  bool ok = false;
  do {
    for (int i = 1; i < 6; i++) {
      if (((d[i-1] < d[i] && d[i] > d[i+1]) ||
           (d[i-1] > d[i] && d[i] < d[i+1])) &&
          d[i-1] < d[i+1]) {
        ok = true;
      }
    }
  } while(next_permutation(d, d+7));
  puts(ok?"YES":"NO");
  return 0;
}










0