結果

問題 No.1944 ∞
ユーザー srjywrdnprkt
提出日時 2023-06-29 14:00:03
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 568 bytes
コンパイル時間 2,077 ms
コンパイル使用メモリ 201,192 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-20 00:42:56
合計ジャッジ時間 3,016 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main(){

    ll N, X, Y, D2, R, S=0;
    cin >> N >> X >> Y;
    vector<ll> r(N);
    D2 = X*X+Y*Y;
    for (int i=0; i<N; i++) cin >> r[i];
    sort(r.begin(), r.end());

    R = r[0];
    for (int i=1; i<N; i++) S += r[i]*2;

    if (N == 1){
        cout << (D2 == R*R ? "Yes" : "No") << endl;
        return 0;
    }
    if (R*R <= D2) cout << ((D2+R+S-1)/(R+S) <= (R+S) ? "Yes" : "No") << endl;
    else cout << (((R-S<=0) || ((R-S)*(R-S) <= D2)) ? "Yes" : "No") << endl;

    return 0;
}
0