結果

問題 No.442 和と積
ユーザー ぴろずぴろず
提出日時 2016-11-27 09:11:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 1,000 ms
コード長 355 bytes
コンパイル時間 1,969 ms
コンパイル使用メモリ 71,580 KB
実行使用メモリ 56,080 KB
最終ジャッジ日時 2023-09-18 06:34:17
合計ジャッジ時間 5,660 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,476 KB
testcase_01 AC 124 ms
56,080 KB
testcase_02 AC 125 ms
55,632 KB
testcase_03 AC 126 ms
55,496 KB
testcase_04 AC 126 ms
55,628 KB
testcase_05 AC 128 ms
55,516 KB
testcase_06 AC 127 ms
55,588 KB
testcase_07 AC 126 ms
55,512 KB
testcase_08 AC 125 ms
55,796 KB
testcase_09 AC 130 ms
55,964 KB
testcase_10 AC 127 ms
55,880 KB
testcase_11 AC 126 ms
55,400 KB
testcase_12 AC 124 ms
55,536 KB
testcase_13 AC 124 ms
55,744 KB
testcase_14 AC 124 ms
55,472 KB
testcase_15 AC 123 ms
55,832 KB
testcase_16 AC 123 ms
55,564 KB
testcase_17 AC 126 ms
55,548 KB
testcase_18 AC 123 ms
55,704 KB
testcase_19 AC 125 ms
55,300 KB
testcase_20 AC 124 ms
55,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no441;

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		BigInteger a = sc.nextBigInteger();
		BigInteger b = sc.nextBigInteger();
		BigInteger sum = a.add(b);
		BigInteger mul = a.multiply(b);
		System.out.println(sum.gcd(mul));
	}

}
0