結果
| 問題 |
No.1064 ∪∩∩ / Cup Cap Cap
|
| コンテスト | |
| ユーザー |
queee
|
| 提出日時 | 2020-05-29 22:44:00 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,222 bytes |
| コンパイル時間 | 1,485 ms |
| コンパイル使用メモリ | 90,452 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-06 06:38:29 |
| 合計ジャッジ時間 | 2,505 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 36 |
ソースコード
#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-10) {
cout<<"Yes"<<endl;
} else if (D>0) {
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;
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;
}
}
queee