結果

問題 No.1064 ∪∩∩ / Cup Cap Cap
ユーザー どららどらら
提出日時 2020-05-29 21:47:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 812 bytes
コンパイル時間 1,633 ms
コンパイル使用メモリ 163,888 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-23 21:11:59
合計ジャッジ時間 2,739 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  ll a, b, c, d;
  cin >> a >> b >> c >> d;

  ll D = (a-c)*(a-c) - 8*(b-d);

  if(D < 0){
    cout << "No" << endl;
  }
  else if(D == 0){
    cout << "Yes" << endl;
  }
  else {
    double x1 = (-(a-c)+sqrt(D))/4.0;
    double x2 = (-(a-c)-sqrt(D))/4.0;
    double y1 = x1*x1+a*x1+b;
    double y2 = x2*x2+a*x2+b;

    double a = (y2-y1)/(x2-x1);
    double b = y1 - a*x1;

    cout << x1 << " " << y1 << " " << x2 << " " << y2 << endl;
    printf("%.12lf %.12lf\n", a, b);
  }
  
  return 0;
}

0