結果
問題 |
No.955 ax^2+bx+c=0
|
ユーザー |
|
提出日時 | 2020-01-01 22:17:35 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 519 bytes |
コンパイル時間 | 897 ms |
コンパイル使用メモリ | 31,104 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-22 17:15:27 |
合計ジャッジ時間 | 3,315 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 35 WA * 87 |
ソースコード
#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%-11lf\n%-11lf\n", s1, s2); } else if (D == 0) { s1 = (double)-b/(2*a); printf("1\n%-11lf\n", s1); } else { printf("0\n"); } return EXIT_SUCCESS; }