結果
問題 | No.1395 Less Sweet Alchemy |
ユーザー |
![]() |
提出日時 | 2021-02-14 21:35:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 641 bytes |
コンパイル時間 | 1,776 ms |
コンパイル使用メモリ | 170,192 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-22 08:59:52 |
合計ジャッジ時間 | 2,476 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N, X; cin >> N >> X; vector<int> C(N); rep(i, N) cin >> C[i]; if(N == 1){ if(X == C[0]){ cout << "Yes" << endl; }else{ cout << "No" << endl; } }else{ if(any_of(C.begin(), C.end(), [&](int x){ return x == X;})){ cout << "Yes" << endl; }else if( any_of(C.begin(), C.end(), [&](int x){ return x <= X;}) && any_of(C.begin(), C.end(), [&](int x){ return x >= X;}) ){ cout << "Yes" << endl; }else{ cout << "No" << endl; } } }