結果
| 問題 |
No.1179 Quadratic Equation
|
| コンテスト | |
| ユーザー |
kumakumaaaaa
|
| 提出日時 | 2020-08-21 22:35:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 594 bytes |
| コンパイル時間 | 1,371 ms |
| コンパイル使用メモリ | 166,312 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-15 06:00:14 |
| 合計ジャッジ時間 | 1,916 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 2 |
ソースコード
#include <bits/stdc++.h>
#define INF 2000000000000000000
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll a, b, c;
cin >> a >> b >> c;
ll D = b * b - 4 * a * c;
if (D < 0) {
cout << "imaginary" << "\n";
}
else if (D == 0) {
double ans = -b;
ans /= 2 * a;
cout << fixed << setprecision(15) << ans << "\n";
}
else {
double ans = -b - pow(D, 0.5);
ans /= 2.0 * a;
cout << fixed << setprecision(15) << ans << " ";
ans = -b + pow(D, 0.5);
ans /= 2.0 * a;
cout << ans << "\n";
}
}
kumakumaaaaa