結果
| 問題 |
No.998 Four Integers
|
| コンテスト | |
| ユーザー |
rjkuro
|
| 提出日時 | 2020-02-28 21:30:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 1,422 bytes |
| コンパイル時間 | 779 ms |
| コンパイル使用メモリ | 97,060 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-30 23:04:03 |
| 合計ジャッジ時間 | 1,514 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
// https://atcoder.jp/contests/abcXXX/tasks/abcXXX_x
#include <iostream>
#include <vector>
#include <tuple>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <cassert>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pll = pair<ll, ll>;
static const ll INF = 1001001001;
static const ll LLINF = 1001001001001001001;
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define RANGE(i, m, n) for(ll i = (m); i <= (n); ++i)
#define RRANGE(i, m, n) for(ll i = (m); i >= (n); --i)
#define POSITIVE(x) (x)=((x) < 0) ? 0 : (x)
ll power(ll x, ll y) {
ll ret = 1;
while(y-- > 0) ret *= x;
return ret;
}
ll gcd(ll a, ll b) {
assert(a >= 0);
assert(b >= 0);
if (b == 0) return a;
return gcd(b, a % b);
}
ll extgcd(ll a, ll b, ll& x, ll& y) {
x = 1; y = 0;
assert(a >= 0);
assert(b >= 0);
if (b == 0) return a;
ll X, Y;
auto d = extgcd(b, a % b, X, Y);
x = Y;
y = X - (a / b) * Y;
return d;
}
int run(istream& in, ostream& out) {
vector<ll> v(4);
in >> v[0] >> v[1] >> v[2] >> v[3];
sort(v.begin(), v.end());
if (v[0] + 1 == v[1] && v[1] +1 == v[2] && v[2]+1 == v[3]) {
out << "Yes" << endl;
} else {
out << "No" << endl;
}
return 0;
}
int main() {
return run(cin, cout);
}
rjkuro