結果
| 問題 |
No.955 ax^2+bx+c=0
|
| コンテスト | |
| ユーザー |
cureskol
|
| 提出日時 | 2020-04-17 21:08:40 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 543 bytes |
| コンパイル時間 | 1,543 ms |
| コンパイル使用メモリ | 166,616 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-03 10:41:55 |
| 合計ジャッジ時間 | 3,821 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 45 WA * 77 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
using ld=long double;
signed main(){
int a,b,c;cin>>a>>b>>c;
if(!a){
cout<<1<<endl;
cout<<fixed<<setprecision(12)<<(ld)(-c)/b<<endl;
}
if(b*b-4*a*c>0){
cout<<2<<endl;
cout<<fixed<<setprecision(12)<<(-b-sqrt(b*b-4*a*c))/(2*a)<<endl;
cout<<fixed<<setprecision(12)<<(-b+sqrt(b*b-4*a*c))/(2*a)<<endl;
}
if(b*b-4*a*c==0){
cout<<1<<endl;
cout<<fixed<<setprecision(12)<<(ld)(-b)/(2*a)<<endl;
}
if(b*b-4*a*c<0){
cout<<0<<endl;
}
}
cureskol