結果
| 問題 |
No.1064 ∪∩∩ / Cup Cap Cap
|
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2020-05-29 21:45:06 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 850 bytes |
| コンパイル時間 | 90 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,392 KB |
| 最終ジャッジ日時 | 2024-11-06 03:25:02 |
| 合計ジャッジ時間 | 2,508 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 22 WA * 14 |
ソースコード
#!/usr/bin/env python3
import decimal
import math
def analyze(a, b, c, d):
det = (a - c) * (a - c) - decimal.Decimal(8) * (b - d)
if det < 0:
return (0, None)
elif det == 0:
return (1, None)
else:
sqrt_det = det ** decimal.Decimal(0.5)
x_1 = (-b - sqrt_det) / decimal.Decimal(4)
x_2 = (-b + sqrt_det) / decimal.Decimal(4)
y_1 = x_1 * x_1 + a * x_1 + b
y_2 = x_2 * x_2 + a * x_2 + b
p = (y_1 - y_2) / (x_1 - x_2)
q = y_1 - p * x_1
return (2, (p, q))
def main():
a, b, c, d = (decimal.Decimal(z) for z in input().split())
num, pq = analyze(a, b, c, d)
if num == 0:
print("No")
elif num == 1:
print("Yes")
else:
p, q = pq
print("{:.12f} {:.12f}".format(p, q))
if __name__ == '__main__':
main()
はむ吉🐹