結果
問題 | No.1395 Less Sweet Alchemy |
ユーザー |
|
提出日時 | 2021-02-14 21:22:21 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 473 bytes |
コンパイル時間 | 661 ms |
コンパイル使用メモリ | 65,792 KB |
最終ジャッジ日時 | 2025-01-18 20:32:09 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
#line 1 "main.cpp" #include <iostream> using namespace std; void solve() { int n, x; cin >> n >> x; bool pos = false, neg = false; while (n--) { int c; cin >> c; if (c == x) { cout << "Yes\n"; return; } (c > x ? pos : neg) = true; } cout << (pos && neg ? "Yes" : "No") << "\n"; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); solve(); return 0; }