結果
| 問題 |
No.1395 Less Sweet Alchemy
|
| コンテスト | |
| ユーザー |
tabae326
|
| 提出日時 | 2021-02-14 21:38:46 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 617 bytes |
| コンパイル時間 | 1,973 ms |
| コンパイル使用メモリ | 193,648 KB |
| 最終ジャッジ日時 | 2025-01-18 20:47:34 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
void solve() {
ll n, x;
cin >> n >> x;
vector<ll> c(n);
rep(i, 0, n) cin >> c[i];
rep(i, 0, n) c[i] -= x;
bool pos = false, neg = false, equ = false;
rep(i, 0, n) {
if(c[i] < 0) neg = true;
if(c[i] == 0) equ = true;
if(c[i] > 0) pos = true;
}
if(equ || (neg && pos)) cout << "Yes\n";
else cout << "No\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}
tabae326