program_contest_library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub ferin-15/program_contest_library

:heavy_check_mark: test/yuki998.test.cpp

Back to top page

Depends on

Code

#define PROBLEM "https://yukicoder.me/problems/no/998"
#include "../memo/macro.hpp"

signed main(void) {
    vector<ll> v(4);
    REP(i, 4) cin >> v[i];
    sort(ALL(v));

    bool flag = true;
    FOR(i, 1, 4) if(v[i] != v[i-1]+1) flag = false;
    if(flag) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

#line 1 "test/yuki998.test.cpp"
#define PROBLEM "https://yukicoder.me/problems/no/998"
#line 1 "memo/macro.hpp"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;
const ll INF = 1LL<<60;
#line 3 "test/yuki998.test.cpp"

signed main(void) {
    vector<ll> v(4);
    REP(i, 4) cin >> v[i];
    sort(ALL(v));

    bool flag = true;
    FOR(i, 1, 4) if(v[i] != v[i-1]+1) flag = false;
    if(flag) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Back to top page