結果

問題 No.1064 ∪∩∩ / Cup Cap Cap
ユーザー syomusyomu
提出日時 2020-05-29 22:23:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,981 bytes
コンパイル時間 1,659 ms
コンパイル使用メモリ 168,292 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-23 23:17:02
合計ジャッジ時間 2,345 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h> //全てのヘッダファイルをインクルード

//ループ
#define REP(i, n) for(int i = 0; i < n; i++) //普通のループ
#define REPR(i, n) for(int i = n; i >= 0; i--) //逆ループ
#define FOR(i, m, n) for(int i = m; i < n; i++) //最初の数値を指定したループ

//型名省略
typedef long long ll;

//配列要素数
static const int MAX = 200000;

using namespace std;

//#include "./lib/generic/sort.h"

std::tuple<int, int> swap(int num1, int num2){
     return std::forward_as_tuple(num1, num2);
}

void traceArray(int A[], int N){
    for(int i=0; i<N; i++){
        cout << A[i];
        if(i!=N-1){
            cout  << " ";
        }
    }
    cout << endl;
}

int push(int A[], int pointer, int tmp){
    A[pointer] = tmp;
    return pointer++;
}

int main(){
    /*int  N;
    cin >> N;
    int  A[N];
    REP(i, N) cin >> A[i];*/
    //sort::Sort test;
    //test.sortByIntention(A, N);
    //test.sortByBubble(A, N);
    //test.sortBySelection(A, N);
    //traceArray(A, N);

     /*int N=200, pointer=0;
     int A[N];
     char tmp;
     while(1){
         cin >> tmp;
         //pointer == push(A, pointer, tmp);
         if(cin.eof()){
            cout << "bbb" << endl;
             break;
         }
     }*/

     /*ll n;
     cin >> n;

     ll a=2, v1=1;
     while(n>=a*a){
         if(n%(a*a)==0){
             n/=a*a;
             v1*=a;
         }else{
             a++;
         }
     }

     cout << v1 << " " << n;*/

     ll a, b, c, d;
     cin >> a >> b >> c >> d;

     double D, x1, x2, y1, y2, p, q;
     D = pow(a-c,2.0)-8*(b-d);

     if(D==0){
         cout << "Yes";
     }else if(D<0){
         cout << "No";
     }else{
         x1 = (-(a-c)+sqrt(D))/4;
         x2 = (-(a-c)-sqrt(D))/4;
         y1 = x1*x1+a*x1+b;
         y2 = x2*x2+a*x2+b;
         p = (y2-y1)/(x2-x1);
         q = y1-p*x1;
         cout << std::fixed << std::setprecision(10) << p << " " << q;
     }

    return 0;
}
0