結果

問題 No.1944 ∞
ユーザー ruthen71
提出日時 2022-05-20 23:50:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 857 bytes
コンパイル時間 1,937 ms
コンパイル使用メモリ 199,092 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-06-20 00:28:47
合計ジャッジ時間 3,063 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#ifdef _RUTHEN
#include "debug.hpp"
#else
#define show(...) true
#endif

using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
template <class T> using V = vector<T>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll N, X, Y;
    cin >> N >> X >> Y;
    V<ll> R(N);
    rep(i, N) cin >> R[i];
    if (N == 1) {
        if (X * X + Y * Y == R[0] * R[0]) {
            cout << "Yes" << '\n';
        } else {
            cout << "No" << '\n';
        }
    } else {
        sort(R.begin(), R.end());
        ll rs = R[0];
        for (int i = 1; i < N; i++) {
            rs += 2 * R[i];
        }
        if (rs >= 2000000000 || X * X + Y * Y <= rs * rs) {
            cout << "Yes" << '\n';
        } else {
            cout << "No" << '\n';
        }
    }
    return 0;
}
0