結果
| 問題 |
No.1064 ∪∩∩ / Cup Cap Cap
|
| コンテスト | |
| ユーザー |
🍮かんプリン
|
| 提出日時 | 2020-05-29 22:34:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 630 bytes |
| コンパイル時間 | 1,513 ms |
| コンパイル使用メモリ | 159,144 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-06 06:03:49 |
| 合計ジャッジ時間 | 2,503 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 36 |
ソースコード
/**
* @FileName b.cpp
* @Author kanpurin
* @Created 2020.05.29 22:33:54
**/
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
ll a,b,c,d;
double f(double x) {
return x*x+a*x+b;
}
int main() {
cin >> a >> b >> c >> d;
ll D = (a-c)*(a-c) - 8*(b-d);
if (D == 0) {
puts("Yes");
}
else if (D < 0) {
puts("No");
}
else {
double x1,x2;
x1 = (double(-(a-c))+sqrt(D))/4;
x2 = (double(-(a-c))-sqrt(D))/4;
double p = (f(x1)-f(x2))/(x1-x2);
double q = -p*x1+f(x1);
printf("%.10f %.10f\n",p,q);
}
return 0;
}
🍮かんプリン