結果

問題 No.442 和と積
ユーザー itezpaceitezpace
提出日時 2017-02-13 07:29:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 1,000 ms
コード長 626 bytes
コンパイル時間 3,845 ms
コンパイル使用メモリ 72,024 KB
実行使用メモリ 57,792 KB
最終ジャッジ日時 2023-09-18 06:49:30
合計ジャッジ時間 7,258 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,128 KB
testcase_01 AC 121 ms
56,116 KB
testcase_02 AC 121 ms
55,880 KB
testcase_03 AC 120 ms
56,080 KB
testcase_04 AC 120 ms
56,432 KB
testcase_05 AC 121 ms
57,792 KB
testcase_06 AC 120 ms
56,160 KB
testcase_07 AC 121 ms
56,248 KB
testcase_08 AC 124 ms
56,040 KB
testcase_09 AC 121 ms
55,712 KB
testcase_10 AC 123 ms
55,964 KB
testcase_11 AC 120 ms
55,928 KB
testcase_12 AC 124 ms
56,244 KB
testcase_13 AC 122 ms
55,904 KB
testcase_14 AC 121 ms
55,804 KB
testcase_15 AC 120 ms
56,112 KB
testcase_16 AC 124 ms
55,952 KB
testcase_17 AC 118 ms
55,644 KB
testcase_18 AC 126 ms
55,992 KB
testcase_19 AC 120 ms
55,884 KB
testcase_20 AC 120 ms
55,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.math.BigInteger;

public class Yuki442{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long a = sc.nextLong();
    long b = sc.nextLong();
    String s_a = Long.toString(a);
    String s_b = Long.toString(b);
    BigInteger big_a = new BigInteger(s_a);
    BigInteger big_b = new BigInteger(s_b);
    BigInteger big_c = big_a;
    big_c = big_c.add(big_b);
    BigInteger big_d = big_a;
    big_d = big_d.multiply(big_b);
    BigInteger big_e = big_c;
    big_e = big_e.gcd(big_d);
    long c = big_e.longValue();
    System.out.println(c);
  }
}
0