結果
問題 |
No.1179 Quadratic Equation
|
ユーザー |
👑 |
提出日時 | 2022-08-17 01:08:21 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 501 bytes |
コンパイル時間 | 715 ms |
コンパイル使用メモリ | 89,240 KB |
最終ジャッジ日時 | 2025-01-30 23:14:31 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 2 |
ソースコード
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main(){ int 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 << fixed << setprecision(10) << -(double)b/(2*(double)a) << endl; }else{ double x = b*b-(4*a*c); if(a < 0)a *= -1; cout << fixed << setprecision(10) << (-(double)b-sqrt(x))/(2*(double)a) << " " << (-(double)b+sqrt(x))/(2*(double)a) << endl; } }