結果

問題 No.1179 Quadratic Equation
ユーザー pes_magic
提出日時 2020-08-21 21:48:59
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 405 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 68,096 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-15 05:32:08
合計ジャッジ時間 1,280 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int main(){
    int a, b, c;
    while(cin >> a >> b >> c){
        int D = b*b - 4*a*c;
        if(D > 0){
            printf("%.10lf %.10lf\n", 0.5*(-b-sqrt(D))/a, 0.5*(-b+sqrt(D))/a);
        } else if(D == 0){
            printf("%.10lf\n", 0.5*(-b)/a);
        } else {
            printf("imaginary\n");
        }
    }
}
0