結果

問題 No.1944 ∞
ユーザー cho435
提出日時 2022-05-25 00:59:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 568 bytes
コンパイル時間 1,493 ms
コンパイル使用メモリ 167,152 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-20 00:35:51
合計ジャッジ時間 2,457 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (int i=0;i<(int)(n);i++)

ll d2(ll x){
  double y=x;
  y=y*y;
  if(y>4e18) return 4e18;
  else return x*x;
}

int main(){
  ll n,x,y;
  cin>>n>>x>>y;
  vector<ll> r(n);
  ll rs=0;
  rep(i,n){
    cin>>r.at(i);
    rs+=r.at(i)*2;
  }
  sort(r.begin(),r.end());
  rs-=r.at(0);
  if(n==1){
    if(x*x+y*y==r.at(0)*r.at(0)) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
  }
  ll fxy=x*x+y*y;
  ll rrs=d2(rs);
  if(rrs<fxy) cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
}
0