結果

問題 No.360 増加門松列
コンテスト
ユーザー 0w1
提出日時 2016-11-25 18:55:22
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 621 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,053 ms
コンパイル使用メモリ 190,556 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2026-05-21 17:31:57
合計ジャッジ時間 2,195 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

const string msg[] = { "NO", "YES" };

int kado( int x, int y, int z ){
  if( x == y or y == z or z == x )
    return 0;
  if( not ( min( { x, y, z } ) == y or max( { x, y, z } ) == y ) )
    return 0;
  return x < z;
}

signed main(){
  vector< int > D( 7 );
  for( int i = 0; i < 7; ++i )
    cin >> D[ i ];
  sort( D.begin(), D.end() );
  do{
    for( int i = 0; i + 3 <= 7; ++i )
      if( kado( D[ i ], D[ i + 1 ], D[ i + 2 ] ) )
        cout << msg[ 1 ] << endl, exit( 0 );
  } while( next_permutation( D.begin(), D.end() ) );
  cout << msg[ 0 ] << endl;
  return 0;
}
0