結果

問題 No.1064 ∪∩∩ / Cup Cap Cap
ユーザー ui_mtc
提出日時 2020-03-30 01:10:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 638 bytes
コンパイル時間 1,520 ms
コンパイル使用メモリ 167,400 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-27 02:20:28
合計ジャッジ時間 2,508 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 22 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define int long long 
using namespace std;
using Graph = vector<vector<int>>;


signed main(){
  cout << fixed << setprecision(12);
  double a, b, c, d;
  cin >> a >> b >> c >> d;
  
  double k = sqrt(a*a-2*a*c+c*c-8*b+8*d);
  double ans1 = (c-a+k)/4;
  double ans2 = (c-a-k)/4;
  if( ans1 == ans2 ){
    if( ans1*ans1 + a*ans1 + b == -1*ans1*ans1 + c*ans1 + d ){
      cout << "Yes" << endl;
    }else cout << "No" << endl;
  }else{
    if( ans1*ans1+a*ans1+b == -1*ans1*ans1+c*ans1+d && ans2*ans2+a*ans2+b == -1*ans2*ans2+c*ans2+d ){
      cout << "" << endl;
    }else{
      cout << "No" << endl;
    }
  }
}
0