結果
問題 | No.955 ax^2+bx+c=0 |
ユーザー |
|
提出日時 | 2020-01-01 22:25:39 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 519 bytes |
コンパイル時間 | 260 ms |
コンパイル使用メモリ | 30,976 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-22 17:15:32 |
合計ジャッジ時間 | 2,793 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 45 WA * 77 |
ソースコード
#include <stdio.h> #include <stdlib.h> #include <math.h> int main(void) { long a, b, c; scanf("%ld%ld%ld", &a, &b, &c); long long D = (long long)b*b - (long long)4*a*c; double s1, s2; if (D > 0) { s1 = (double)-b/(2*a) - sqrt(D)/(2*a); s2 = (double)-b/(2*a) + sqrt(D)/(2*a); printf("2\n%.16lf\n%.16lf\n", s1, s2); } else if (D == 0) { s1 = (double)-b/(2*a); printf("1\n%.16lf\n", s1); } else { printf("0\n"); } return EXIT_SUCCESS; }