結果
問題 | No.1179 Quadratic Equation |
ユーザー |
![]() |
提出日時 | 2020-08-21 22:54:42 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 487 bytes |
コンパイル時間 | 2,169 ms |
コンパイル使用メモリ | 193,940 KB |
最終ジャッジ日時 | 2025-01-13 06:28:46 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; double e=sqrt((double)d); 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-e)/2/a<<" "<<(double)(-b+e)/2/a<<endl; } return 0; }