結果

問題 No.1944 ∞
ユーザー umezo
提出日時 2022-05-20 22:55:42
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 568 bytes
コンパイル時間 2,150 ms
コンパイル使用メモリ 199,512 KB
最終ジャッジ日時 2025-01-29 11:18:29
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;

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

int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  ll n,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(ALL(R));
  ll sum=0;
  rep(i,n){
    if(i==0) sum+=R[i];
    else sum+=2*R[i];
  }
  if(x*x+y*y<=sum*sum) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

  return 0;
}
0