結果
| 問題 | No.1179 Quadratic Equation |
| コンテスト | |
| ユーザー |
keisuke6
|
| 提出日時 | 2022-08-26 22:52:15 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 462 bytes |
| 記録 | |
| コンパイル時間 | 1,912 ms |
| コンパイル使用メモリ | 193,040 KB |
| 最終ジャッジ日時 | 2025-01-31 05:22:39 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int a,b,c;
cin>>a>>b>>c;
if(4*a*c > b*b){
cout<<"imaginary"<<endl;
}
else if(4*a*c == b*b){
cout<<fixed<<setprecision(12);
cout<<-b*0.5/a<<endl;
}
else{
cout<<fixed<<setprecision(12);
cout<<min(-b*0.5/a-sqrt(b*b-4*a*c)/(2*a),-b*0.5/a+sqrt(b*b-4*a*c)/2)<<' '<<max(-b*0.5/a-sqrt(b*b-4*a*c)/(2*a),-b*0.5/a+sqrt(b*b-4*a*c)/2)<<endl;
}
}
keisuke6