結果

問題 No.1064 ∪∩∩ / Cup Cap Cap
ユーザー queeequeee
提出日時 2020-05-29 22:43:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,303 bytes
コンパイル時間 1,394 ms
コンパイル使用メモリ 91,200 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 00:09:37
合計ジャッジ時間 2,528 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 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 1 ms
5,376 KB
testcase_27 AC 2 ms
5,376 KB
testcase_28 AC 2 ms
5,376 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 1 ms
5,376 KB
testcase_31 AC 1 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 #

#pragma GCC target("avx")
#pragma GCC optimize("O3")

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <functional>
#define DB puts("D")
#define pb push_back

using namespace std; using ll=long long; using ld=long double; const int INF=1e9; const ll LINF=1e18;
template<typename T, typename U, typename O> void caut(T a, U b, O c){cout<<"("<<a<<","<<b<<","<<c<<") ";}
template<typename T, typename U> void caut(T a, U b){cout<<"("<<a<<","<<b<<") ";}
template<typename T> void caut(T a){cout<<"("<<a<<") ";}
void input(int a[], int n){for(int i=0;i<n;i++) cin>>a[i];}

using P=pair<ll,ll>;
const ll M = 1e9+7;

int main() {
  // 2x2 + (a-c)x + b-d = 0;
  // D=(a-c)^2 - 4*2*(b-d)
  ld a,b,c,d; cin>>a>>b>>c>>d;
  ld A=2, B=a-c, C=b-d;
  ld D = B*B-4*A*C;
  if (abs(D) < 1e-5) {
    cout<<"Yes"<<endl;
  } else if (D>0) {
    cout<<A<<" "<<B<<" "<<C<<endl;
    ld x1 = (-B-sqrt(B*B-4*A*C))/2/A;
    ld x2 = (-B+sqrt(B*B-4*A*C))/2/A;
    ld y1 = x1*x1 + a*x1 + b;
    ld y2 = x2*x2 + a*x2 + b;
    cout<<x1<<" "<<x2<<" "<<y1<<" "<<y2<<endl;
    ld p = (y2-y1)/(x2-x1);
    // y-y1 = p(x-x1) : y = px - px1 + y1
    ld q = -p*x1 + y1;
    cout.precision(10);
    cout<<p<<" "<<q<<endl;
  } else {
    cout<<"No"<<endl;
  }
}
0