結果
問題 |
No.1395 Less Sweet Alchemy
|
ユーザー |
|
提出日時 | 2021-02-17 20:58:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 781 bytes |
コンパイル時間 | 1,836 ms |
コンパイル使用メモリ | 172,652 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-14 06:22:29 |
合計ジャッジ時間 | 2,541 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 6 WA * 6 |
ソースコード
#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] == N) { 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; }