結果
問題 | No.1064 ∪∩∩ / Cup Cap Cap |
ユーザー |
![]() |
提出日時 | 2020-06-02 11:30:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 951 bytes |
コンパイル時間 | 785 ms |
コンパイル使用メモリ | 93,952 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-23 18:24:00 |
合計ジャッジ時間 | 1,964 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 36 |
ソースコード
/* -*- coding: utf-8 -*- * * 1064.cc: No.1064 ∪∩∩ / Cup Cap Cap - yukicoder */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* constant */ /* typedef */ typedef long long ll; /* global variables */ /* subroutines */ /* main */ int main() { ll a, b, c, d; scanf("%lld%lld%lld%lld", &a, &b, &c, &d); /* y = x^2+ax+b = -x^2+cx+d (1) -> 2x^2+(a-c)x+(b-d) = 0 (2) -> 2y = (a+c)x+(b+d) -> y = (a+c)/2x+(b+d)/2 */ ll e = (a - c) * (a - c) - 4 * 2 * (b - d); if (e < 0) puts("No"); else if (e == 0) puts("Yes"); else { double p = (a + c) * 0.5, q = (b + d) * 0.5; printf("%.10lf %.10lf\n", p, q); } return 0; }