結果

問題 No.1395 Less Sweet Alchemy
ユーザー monnumonnu
提出日時 2021-02-14 21:24:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 552 bytes
コンパイル時間 1,535 ms
コンパイル使用メモリ 170,500 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-29 14:26:36
合計ジャッジ時間 1,933 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
using ll=long long;
using Graph=vector<vector<int>>;
#define MOD 1000000007
#define INF 1000000000
#define MAX 500000


int main(){
  int N,X;
  cin>>N>>X;
  vector<int> C(N);
  bool flag=false;
  for(int i=0;i<N;i++){
    cin>>C[i];
    if(C[i]==X){
      flag=true;
    }
  }
  sort(C.begin(),C.end());
  if(flag==true){
    cout<<"Yes"<<endl;
  }else{
    if(C[0]<X&&X<C[N-1]){
      cout<<"Yes"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }

}
0