結果

問題 No.1179 Quadratic Equation
ユーザー Kome_soudou
提出日時 2022-11-09 16:53:00
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 1,753 ms
コンパイル使用メモリ 166,144 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-22 22:44:30
合計ジャッジ時間 2,167 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
	double a, b, c;
	cin >> a >> b >> c;
	
	if(b * b - 4 * a * c < 0) cout << "imaginary" << endl;
	else if(b * b - 4 * a * c == 0) cout << setprecision(16) << -b / (2 * a) << endl;
	else cout << setprecision(16) << (-b - sqrt(b * b - 4 * a * c)) / (2 * a) << ' ' << (-b + sqrt(b * b - 4 * a * c)) / (2 * a) << endl;
	return 0;
}
0