結果
| 問題 |
No.955 ax^2+bx+c=0
|
| コンテスト | |
| ユーザー |
michonz4
|
| 提出日時 | 2019-12-18 14:24:16 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 457 bytes |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 31,104 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-07 00:43:46 |
| 合計ジャッジ時間 | 2,861 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 20 WA * 102 |
ソースコード
#include <stdio.h>
#include <math.h>
int main() {
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
a%=13;
b%=13;
c%=13;
if (a==0) {
printf("-1\n");
return 0;
}
long long D=b*b-4*a*c;
double f=2, s=3;
if (D>0) {
printf("2\n");
printf("%.16lf\n", f<s ? f: s);
printf("%.16lf\n", f<s ? s: f);
} else if (D==0) {
printf("1\n");
printf("%.16lf\n", (-b)/(2.0*a));
} else {
printf("0\n");
}
return 0;
}
michonz4