結果
問題 |
No.1395 Less Sweet Alchemy
|
ユーザー |
|
提出日時 | 2021-02-17 21:00:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 781 bytes |
コンパイル時間 | 1,772 ms |
コンパイル使用メモリ | 172,464 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-14 06:23:54 |
合計ジャッジ時間 | 2,501 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
#include <bits/stdc++.h> #include <iostream> #include<math.h> using namespace std; template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } int main() { int N; cin >> N; int X; cin >> X; vector<int>vec(N); bool is_can = false; for (int i=0; i<N; i++) { cin >> vec.at(i); if (vec[i] == X) { is_can = true; } } if (is_can) { cout << "Yes" << endl; } else { sort(vec.begin(), vec.end()); if (vec[0] < X && vec[N-1] > X) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }