結果

問題 No.955 ax^2+bx+c=0
ユーザー ks2mks2m
提出日時 2019-12-18 00:18:10
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 995 bytes
コンパイル時間 2,028 ms
コンパイル使用メモリ 73,988 KB
実行使用メモリ 51,460 KB
最終ジャッジ日時 2023-09-21 05:09:16
合計ジャッジ時間 11,144 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 42 ms
49,288 KB
testcase_02 AC 42 ms
49,340 KB
testcase_03 AC 42 ms
49,196 KB
testcase_04 AC 42 ms
49,048 KB
testcase_05 AC 43 ms
49,540 KB
testcase_06 AC 42 ms
49,568 KB
testcase_07 AC 42 ms
47,236 KB
testcase_08 AC 43 ms
49,040 KB
testcase_09 AC 43 ms
49,132 KB
testcase_10 AC 43 ms
49,036 KB
testcase_11 AC 43 ms
49,176 KB
testcase_12 AC 43 ms
51,140 KB
testcase_13 AC 43 ms
49,160 KB
testcase_14 AC 42 ms
49,136 KB
testcase_15 AC 41 ms
49,400 KB
testcase_16 AC 42 ms
49,280 KB
testcase_17 AC 42 ms
49,200 KB
testcase_18 AC 43 ms
49,572 KB
testcase_19 AC 42 ms
49,048 KB
testcase_20 AC 43 ms
49,420 KB
testcase_21 AC 42 ms
49,264 KB
testcase_22 AC 42 ms
49,248 KB
testcase_23 AC 42 ms
49,504 KB
testcase_24 AC 42 ms
49,448 KB
testcase_25 AC 42 ms
49,044 KB
testcase_26 AC 42 ms
49,228 KB
testcase_27 AC 43 ms
49,208 KB
testcase_28 AC 41 ms
49,260 KB
testcase_29 AC 42 ms
49,052 KB
testcase_30 AC 42 ms
49,224 KB
testcase_31 AC 42 ms
49,340 KB
testcase_32 AC 41 ms
49,348 KB
testcase_33 AC 42 ms
49,720 KB
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
testcase_47 RE -
testcase_48 RE -
testcase_49 RE -
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
testcase_53 RE -
testcase_54 RE -
testcase_55 RE -
testcase_56 RE -
testcase_57 RE -
testcase_58 RE -
testcase_59 RE -
testcase_60 AC 42 ms
49,200 KB
testcase_61 AC 42 ms
49,156 KB
testcase_62 RE -
testcase_63 RE -
testcase_64 AC 43 ms
49,620 KB
testcase_65 RE -
testcase_66 AC 42 ms
49,236 KB
testcase_67 RE -
testcase_68 AC 42 ms
49,288 KB
testcase_69 RE -
testcase_70 RE -
testcase_71 AC 43 ms
49,128 KB
testcase_72 AC 42 ms
49,352 KB
testcase_73 RE -
testcase_74 RE -
testcase_75 AC 42 ms
49,580 KB
testcase_76 AC 42 ms
49,352 KB
testcase_77 RE -
testcase_78 RE -
testcase_79 RE -
testcase_80 AC 43 ms
49,048 KB
testcase_81 RE -
testcase_82 AC 43 ms
49,344 KB
testcase_83 AC 42 ms
49,180 KB
testcase_84 AC 42 ms
49,140 KB
testcase_85 AC 43 ms
49,352 KB
testcase_86 AC 43 ms
49,128 KB
testcase_87 AC 43 ms
49,252 KB
testcase_88 AC 42 ms
49,188 KB
testcase_89 AC 42 ms
49,228 KB
testcase_90 AC 43 ms
49,244 KB
testcase_91 AC 42 ms
49,504 KB
testcase_92 AC 42 ms
49,188 KB
testcase_93 AC 42 ms
49,116 KB
testcase_94 AC 43 ms
49,124 KB
testcase_95 AC 43 ms
49,196 KB
testcase_96 AC 42 ms
49,212 KB
testcase_97 AC 42 ms
49,056 KB
testcase_98 AC 43 ms
49,376 KB
testcase_99 AC 42 ms
49,264 KB
testcase_100 AC 42 ms
47,372 KB
testcase_101 AC 43 ms
49,140 KB
testcase_102 AC 43 ms
49,204 KB
testcase_103 AC 41 ms
49,224 KB
testcase_104 AC 42 ms
49,240 KB
testcase_105 AC 42 ms
49,232 KB
testcase_106 AC 43 ms
49,356 KB
testcase_107 AC 42 ms
49,188 KB
testcase_108 AC 43 ms
49,192 KB
testcase_109 AC 43 ms
49,508 KB
testcase_110 AC 42 ms
49,148 KB
testcase_111 AC 42 ms
47,316 KB
testcase_112 AC 42 ms
49,104 KB
testcase_113 AC 43 ms
49,264 KB
testcase_114 AC 42 ms
49,352 KB
testcase_115 AC 43 ms
49,228 KB
testcase_116 AC 43 ms
49,384 KB
testcase_117 AC 43 ms
49,124 KB
testcase_118 AC 43 ms
49,348 KB
testcase_119 AC 43 ms
49,260 KB
testcase_120 AC 43 ms
49,052 KB
testcase_121 AC 42 ms
49,352 KB
testcase_122 RE -
testcase_123 RE -
testcase_124 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		long a = Integer.parseInt(sa[0]);
		long b = Integer.parseInt(sa[1]);
		long c = Integer.parseInt(sa[2]);
		br.close();

		if (a == 0) {
			if (b == 0) {
				if (c == 0) {
					System.out.println(-1);
				} else {
					System.out.println(0);
				}
			} else {
				System.out.println(1);
				System.out.println((double) -c / b);
			}
		} else if (b * b == 4 * a * c) {
			System.out.println(1);
			System.out.println((double) -b / 2 / a);
		} else if (b * b > 4 * a * c) {
			double d1 = (double) -b / 2 / a;
			double d2 = Math.sqrt(b * b - 4 * a * c) / 2 / a;
			System.out.println(2);
			System.out.println(d1 - d2);
			System.out.println(d1 + d2);
			throw new RuntimeException();
		} else {
			System.out.println(0);
		}
	}
}
0