結果
問題 | No.955 ax^2+bx+c=0 |
ユーザー | Mcpu3 |
提出日時 | 2020-04-04 21:58:42 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,247 bytes |
コンパイル時間 | 2,080 ms |
コンパイル使用メモリ | 78,672 KB |
実行使用メモリ | 56,500 KB |
最終ジャッジ日時 | 2024-07-03 07:47:32 |
合計ジャッジ時間 | 21,664 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 120 ms
53,856 KB |
testcase_01 | AC | 125 ms
54,548 KB |
testcase_02 | AC | 115 ms
53,456 KB |
testcase_03 | AC | 129 ms
54,500 KB |
testcase_04 | AC | 129 ms
54,532 KB |
testcase_05 | AC | 128 ms
54,312 KB |
testcase_06 | AC | 142 ms
54,416 KB |
testcase_07 | AC | 116 ms
53,624 KB |
testcase_08 | AC | 126 ms
54,420 KB |
testcase_09 | AC | 132 ms
54,820 KB |
testcase_10 | AC | 125 ms
54,492 KB |
testcase_11 | AC | 127 ms
54,488 KB |
testcase_12 | AC | 132 ms
54,428 KB |
testcase_13 | AC | 139 ms
54,568 KB |
testcase_14 | AC | 145 ms
54,696 KB |
testcase_15 | AC | 135 ms
54,496 KB |
testcase_16 | AC | 135 ms
54,468 KB |
testcase_17 | AC | 133 ms
54,104 KB |
testcase_18 | AC | 134 ms
54,440 KB |
testcase_19 | AC | 122 ms
53,800 KB |
testcase_20 | AC | 130 ms
54,164 KB |
testcase_21 | AC | 130 ms
54,484 KB |
testcase_22 | AC | 131 ms
54,680 KB |
testcase_23 | AC | 132 ms
54,116 KB |
testcase_24 | AC | 130 ms
54,612 KB |
testcase_25 | AC | 117 ms
53,788 KB |
testcase_26 | AC | 120 ms
53,780 KB |
testcase_27 | AC | 121 ms
53,784 KB |
testcase_28 | AC | 131 ms
54,320 KB |
testcase_29 | AC | 120 ms
53,660 KB |
testcase_30 | AC | 127 ms
54,336 KB |
testcase_31 | AC | 127 ms
54,256 KB |
testcase_32 | AC | 134 ms
54,424 KB |
testcase_33 | AC | 114 ms
53,732 KB |
testcase_34 | AC | 116 ms
53,728 KB |
testcase_35 | AC | 134 ms
54,232 KB |
testcase_36 | AC | 115 ms
53,736 KB |
testcase_37 | AC | 129 ms
54,520 KB |
testcase_38 | AC | 129 ms
54,320 KB |
testcase_39 | AC | 140 ms
54,540 KB |
testcase_40 | AC | 122 ms
53,804 KB |
testcase_41 | AC | 127 ms
54,396 KB |
testcase_42 | AC | 118 ms
53,548 KB |
testcase_43 | AC | 120 ms
53,604 KB |
testcase_44 | AC | 131 ms
54,592 KB |
testcase_45 | AC | 133 ms
54,216 KB |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | WA | - |
testcase_49 | WA | - |
testcase_50 | WA | - |
testcase_51 | WA | - |
testcase_52 | WA | - |
testcase_53 | WA | - |
testcase_54 | WA | - |
testcase_55 | WA | - |
testcase_56 | WA | - |
testcase_57 | WA | - |
testcase_58 | RE | - |
testcase_59 | RE | - |
testcase_60 | AC | 134 ms
54,388 KB |
testcase_61 | AC | 112 ms
53,736 KB |
testcase_62 | RE | - |
testcase_63 | RE | - |
testcase_64 | AC | 130 ms
54,472 KB |
testcase_65 | RE | - |
testcase_66 | AC | 149 ms
54,236 KB |
testcase_67 | RE | - |
testcase_68 | AC | 135 ms
53,844 KB |
testcase_69 | RE | - |
testcase_70 | RE | - |
testcase_71 | AC | 129 ms
54,612 KB |
testcase_72 | AC | 119 ms
53,964 KB |
testcase_73 | RE | - |
testcase_74 | RE | - |
testcase_75 | AC | 128 ms
54,624 KB |
testcase_76 | AC | 129 ms
54,576 KB |
testcase_77 | RE | - |
testcase_78 | RE | - |
testcase_79 | RE | - |
testcase_80 | AC | 114 ms
53,468 KB |
testcase_81 | RE | - |
testcase_82 | AC | 108 ms
53,724 KB |
testcase_83 | AC | 118 ms
53,892 KB |
testcase_84 | AC | 133 ms
54,228 KB |
testcase_85 | AC | 129 ms
54,624 KB |
testcase_86 | AC | 133 ms
54,204 KB |
testcase_87 | AC | 136 ms
54,440 KB |
testcase_88 | AC | 138 ms
54,208 KB |
testcase_89 | AC | 134 ms
54,320 KB |
testcase_90 | AC | 130 ms
54,408 KB |
testcase_91 | AC | 129 ms
54,224 KB |
testcase_92 | AC | 118 ms
53,464 KB |
testcase_93 | AC | 130 ms
54,376 KB |
testcase_94 | AC | 137 ms
54,208 KB |
testcase_95 | RE | - |
testcase_96 | RE | - |
testcase_97 | AC | 142 ms
54,160 KB |
testcase_98 | AC | 137 ms
54,412 KB |
testcase_99 | RE | - |
testcase_100 | AC | 132 ms
54,484 KB |
testcase_101 | AC | 111 ms
53,272 KB |
testcase_102 | RE | - |
testcase_103 | RE | - |
testcase_104 | RE | - |
testcase_105 | RE | - |
testcase_106 | RE | - |
testcase_107 | RE | - |
testcase_108 | RE | - |
testcase_109 | RE | - |
testcase_110 | RE | - |
testcase_111 | RE | - |
testcase_112 | RE | - |
testcase_113 | RE | - |
testcase_114 | RE | - |
testcase_115 | RE | - |
testcase_116 | RE | - |
testcase_117 | RE | - |
testcase_118 | RE | - |
testcase_119 | RE | - |
testcase_120 | RE | - |
testcase_121 | RE | - |
testcase_122 | AC | 131 ms
54,072 KB |
testcase_123 | AC | 140 ms
54,696 KB |
testcase_124 | WA | - |
ソースコード
import java.math.BigDecimal; import java.math.MathContext; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); BigDecimal a = scanner.nextBigDecimal(), b = scanner.nextBigDecimal(), c = scanner.nextBigDecimal(); if (a.equals(BigDecimal.ZERO)) { if (b.equals(BigDecimal.ZERO)) { if (c.equals(BigDecimal.ZERO)) System.out.print(-1); else System.out.print(0); } else { System.out.println(1); System.out.print(BigDecimal.ZERO.subtract(c).divide(b).toPlainString()); } } else { BigDecimal d = b.multiply(b).subtract(a.multiply(c).multiply(new BigDecimal(4))); if (d.compareTo(BigDecimal.ZERO) == 1) { System.out.println(2); System.out.println((BigDecimal.ZERO.subtract(d.sqrt(MathContext.DECIMAL128)).subtract(b)).divide(a.multiply(new BigDecimal(2))).toPlainString()); System.out.print((d.sqrt(MathContext.DECIMAL128).subtract(b)).divide(a.multiply(new BigDecimal(2))).toPlainString()); } else if (d.equals(BigDecimal.ZERO)) { System.out.println(1); System.out.print(BigDecimal.ZERO.subtract(b).divide(a.multiply(new BigDecimal(2)))); } else System.out.print(0); } } }