結果

問題 No.1064 ∪∩∩ / Cup Cap Cap
ユーザー chocono2230chocono2230
提出日時 2020-05-29 22:02:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,239 bytes
コンパイル時間 1,574 ms
コンパイル使用メモリ 164,272 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-23 22:26:32
合計ジャッジ時間 2,354 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 1 ms
6,944 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 WA -
testcase_17 AC 2 ms
6,944 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
6,940 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 1 ms
6,940 KB
testcase_35 AC 2 ms
6,940 KB
testcase_36 AC 2 ms
6,940 KB
testcase_37 AC 2 ms
6,944 KB
testcase_38 WA -
testcase_39 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

typedef long double ld;
const ld eps = 1.0e-8; // 許容される誤差

ld mysqrtl(ld x)
{
  ld a = sqrt((double)x); // 近似値
  do {
    a = (a + x/a) / 2.0L;
  } while (fabsl(x - a*a) > eps);
  return a;
}

int main(){
  int ia, ib, ic, id;
  long double  a, b, c, d;
  cin >> ia >> ib >> ic >> id;
  if(id - ib < 0){
    cout << "No" << endl;
    return 0;
  }else if(id - ib == 0){
    cout << "Yes" << endl;
    return 0;
  }
  a = ia; b = ib; c = ic; d = id;
  long double r = (c-a) * (c-a) + 8*(d-b);
  long double xa = ((c - a) + mysqrtl(r))/4;
  long double xb = ((c - a) - mysqrtl(r))/4;
  long double ya = xa*xa + a*xa + b;
  long double yb = xb*xb + a*xb + b;
  long double p = (yb-ya)/(xb-xa);
  long double q = -p * xa + ya;
  cout << fixed << setprecision(15) << p << " " << q << endl;
  return 0;
}
0