結果
| 問題 | No.1179 Quadratic Equation |
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2020-08-21 22:49:58 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 471 bytes |
| 記録 | |
| コンパイル時間 | 3,962 ms |
| コンパイル使用メモリ | 191,696 KB |
| 最終ジャッジ日時 | 2025-01-13 06:26:11 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 2 |
ソースコード
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
int main() {
ll a,b,c;
cin>>a>>b>>c;
ll d=b*b-4*a*c;
if(d<0){
cout<<"imaginary"<<endl;
}
else if(d==0){
cout<<fixed<<setprecision(10)<<-(double)b/2/a<<endl;
}
else{
cout<<fixed<<setprecision(10)<<(double)(-b-sqrt(d))/2/a<<" "<<(double)(-b+sqrt(d))/2/a<<endl;
}
return 0;
}
umezo