結果
| 問題 |
No.1944 ∞
|
| コンテスト | |
| ユーザー |
platinum
|
| 提出日時 | 2022-05-20 22:31:41 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 74 ms / 2,000 ms |
| コード長 | 651 bytes |
| コンパイル時間 | 1,976 ms |
| コンパイル使用メモリ | 201,180 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-06-20 00:28:09 |
| 合計ジャッジ時間 | 3,360 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 37 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using LL = long long;
using P = pair<int,int>;
using vv = vector<vector<int>>;
const int INF = (int)2e9;
const LL LINF = (LL)1e18;
int main(){
int N;
LL X, Y;
cin >> N >> X >> Y;
vector<LL> R(N);
rep(i,N) cin >> R[i];
if(N == 1){
if(X * X + Y * Y == R[0] * R[0]) cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
}
sort(R.begin(), R.end());
LL tot = R[0];
rep(i,N-1) tot += R[i+1] * 2;
if(tot > INF) cout << "Yes" << endl;
else if(tot * tot >= X * X + Y * Y) cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
}
platinum