結果

問題 No.1064 ∪∩∩ / Cup Cap Cap
ユーザー monkukui2
提出日時 2020-05-29 21:40:52
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,472 bytes
コンパイル時間 838 ms
コンパイル使用メモリ 94,724 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-06 03:01:46
合計ジャッジ時間 2,021 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 35 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>
using namespace std;
using lint = long long int;
long long int INF = 1001001001001001LL;
int inf = 1000000007;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;
template<typename T1,typename T2>inline void chmin(T1 &a,const T2 &b){if(a>b) a=b;}
template<typename T1,typename T2>inline void chmax(T1 &a,const T2 &b){if(a<b) a=b;}
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
/* do your best */
int main() {
int a, b, c, d; cin >> a >> b >> c >> d;
int D = (a - c) * (a - c) - 8 * (b - d);
if (D == 0) {
cout << "Yes" << endl;
} else if (D < 0) {
cout << "No" << endl;
} else {
double x1 = (-(a - c) - pow((double)D, 0.5)) / 4.0;
double x2 = (-(a - c) + pow((double)D, 0.5)) / 4.0;
double y1 = (x1 * x1 + a * x1 + b - x1 * x1 + x1 * c + d) / 2.0;
double y2 = (x2 * x2 + a * x2 + b - x2 * x2 + x2 * c + d) / 2.0;
double p = (y2 - y1) / (x2 - x1);
double q1 = y1 - p * x1;
double q2 = y2 - p * x2;
double q = (q1 + q2) / 2.0;
printf("%.10f %.10f\n", p, q);
}
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0