結果
問題 |
No.955 ax^2+bx+c=0
|
ユーザー |
![]() |
提出日時 | 2019-12-28 09:16:32 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 545 bytes |
コンパイル時間 | 3,475 ms |
コンパイル使用メモリ | 74,212 KB |
実行使用メモリ | 55,940 KB |
最終ジャッジ日時 | 2024-10-11 04:27:20 |
合計ジャッジ時間 | 23,909 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 WA * 77 RE * 14 |
ソースコード
import java.util.Scanner; public class No955 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); long D = b * b - 4 * a * c; if(D > 0) { System.out.println(2); System.out.println((-b - Math.pow(D, 0.5f)) / 2 / a); System.out.println((-b + Math.pow(D, 0.5f)) / 2 / a); } else if(D == 0) { System.out.println(1); System.out.println((int)(-b + Math.pow(D, 0.5f)) / 2 / a); } else { System.out.println(0); } } }