結果
問題 |
No.1179 Quadratic Equation
|
ユーザー |
|
提出日時 | 2020-08-21 22:25:11 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 911 bytes |
コンパイル時間 | 2,387 ms |
コンパイル使用メモリ | 109,252 KB |
最終ジャッジ日時 | 2025-01-13 06:12:01 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 5 WA * 6 |
ソースコード
//#pragma GCC optimize ("O3") //#pragma GCC target ("avx") #include <stdio.h> #include <iostream> #include <vector> #include <algorithm> #include <map> #include <queue> #include <cstdio> #include <ctime> #include <assert.h> #include <chrono> #include <random> #include <numeric> #include <set> #include <deque> #include <stack> #include <bitset> using namespace std; typedef long long int ll; typedef unsigned long long ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } constexpr ll mod=1e9+7; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll a,b,c; cin >> a >> b >> c; if(b*b-4*a*c<0){ printf("imaginary\n"); } else if(b*b-4*a*c==0){ double res=-b/2.0/a; printf("%.9f\n",res); } else{ double res=(-b-sqrt(b*b-4*a*c))/2.0/a; double res2=-2.0*c/(b+sqrt(b*b-4*a*c)); printf("%.9f %.9f\n",res2,res); } }