結果

問題 No.441 和か積
ユーザー kenji_shioyakenji_shioya
提出日時 2017-01-08 02:40:01
言語 Java19
(openjdk 21)
結果
AC  
実行時間 120 ms / 1,000 ms
コード長 502 bytes
コンパイル時間 3,631 ms
コンパイル使用メモリ 72,456 KB
実行使用メモリ 56,404 KB
最終ジャッジ日時 2023-09-09 10:34:26
合計ジャッジ時間 8,789 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
55,548 KB
testcase_01 AC 114 ms
56,072 KB
testcase_02 AC 115 ms
56,044 KB
testcase_03 AC 118 ms
55,744 KB
testcase_04 AC 119 ms
56,188 KB
testcase_05 AC 119 ms
56,404 KB
testcase_06 AC 119 ms
55,696 KB
testcase_07 AC 118 ms
56,248 KB
testcase_08 AC 119 ms
56,000 KB
testcase_09 AC 118 ms
55,504 KB
testcase_10 AC 114 ms
55,896 KB
testcase_11 AC 112 ms
56,224 KB
testcase_12 AC 111 ms
55,932 KB
testcase_13 AC 113 ms
55,836 KB
testcase_14 AC 116 ms
56,028 KB
testcase_15 AC 114 ms
55,960 KB
testcase_16 AC 114 ms
55,724 KB
testcase_17 AC 114 ms
56,024 KB
testcase_18 AC 116 ms
56,040 KB
testcase_19 AC 114 ms
55,888 KB
testcase_20 AC 119 ms
55,896 KB
testcase_21 AC 118 ms
55,864 KB
testcase_22 AC 120 ms
55,740 KB
testcase_23 AC 117 ms
55,776 KB
testcase_24 AC 116 ms
56,208 KB
testcase_25 AC 115 ms
56,152 KB
testcase_26 AC 112 ms
55,696 KB
testcase_27 AC 113 ms
56,332 KB
testcase_28 AC 114 ms
56,332 KB
testcase_29 AC 119 ms
55,764 KB
testcase_30 AC 116 ms
55,936 KB
testcase_31 AC 119 ms
55,976 KB
testcase_32 AC 118 ms
56,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.BigDecimal;

public class SumMultiply2 {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    BigDecimal a = new BigDecimal(sc.next());
    BigDecimal b = new BigDecimal(sc.next());

    BigDecimal c = a.add(b);
    BigDecimal d = a.multiply(b);

    if (c.compareTo(d) == -1){
      System.out.println("P");
    }else if (c.compareTo(d) == 0){
      System.out.println("E");
    }else{
      System.out.println("S");
    }
  }
}
0