結果

問題 No.1064 ∪∩∩ / Cup Cap Cap
ユーザー hiroahiroa
提出日時 2020-05-29 21:56:26
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 902 bytes
コンパイル時間 1,618 ms
コンパイル使用メモリ 165,588 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-23 21:56:52
合計ジャッジ時間 2,744 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 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 1 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 2 ms
5,376 KB
testcase_28 AC 2 ms
5,376 KB
testcase_29 AC 1 ms
5,376 KB
testcase_30 AC 1 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 AC 2 ms
5,376 KB
testcase_36 AC 2 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 WA -
testcase_39 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

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

    if(a*a-2*a*c+c*c==8*b-8*d){
        cout<<"Yes"<<endl;
        return 0;
    }
    if(a*a-2*a*c+c*c<8*b-8*d){
        cout<<"No"<<endl;
        return 0;
    }

    long double a1=(double)a;
    long double b1=(double)b;
    long double c1=(double)c;
    long double d1=(double)d;

    long double x1=(-a1+c1+sqrt((a1-c1)*(a1-c1)-8*(b1-d1)))/4;
    long double y1=x1*x1+a1*x1+b1;
    long double x2=(-a1+c1-sqrt((a1-c1)*(a1-c1)-8*(b1-d1)))/4;
    long double y2=(-1)*x2*x2+c1*x2+d1;

    long double p=(y2-y1)/(x2-x1);
    long double q=(y1-y2)/(x2-x1)+y1;

    cout<<fixed<<setprecision(10)<<p<<" ";
    cout<<fixed<<setprecision(10)<<q<<endl;
}


 
0