結果

問題 No.442 和と積
ユーザー Daigo HIROOKADaigo HIROOKA
提出日時 2018-06-13 01:40:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 1,000 ms
コード長 330 bytes
コンパイル時間 3,062 ms
コンパイル使用メモリ 72,556 KB
実行使用メモリ 56,440 KB
最終ジャッジ日時 2023-09-18 07:02:52
合計ジャッジ時間 6,534 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,636 KB
testcase_01 AC 120 ms
55,748 KB
testcase_02 AC 120 ms
55,868 KB
testcase_03 AC 119 ms
55,832 KB
testcase_04 AC 121 ms
55,584 KB
testcase_05 AC 121 ms
55,504 KB
testcase_06 AC 122 ms
56,228 KB
testcase_07 AC 120 ms
55,572 KB
testcase_08 AC 120 ms
55,340 KB
testcase_09 AC 120 ms
55,576 KB
testcase_10 AC 122 ms
55,688 KB
testcase_11 AC 119 ms
55,688 KB
testcase_12 AC 122 ms
55,828 KB
testcase_13 AC 121 ms
55,520 KB
testcase_14 AC 120 ms
55,748 KB
testcase_15 AC 122 ms
55,560 KB
testcase_16 AC 124 ms
55,560 KB
testcase_17 AC 122 ms
56,440 KB
testcase_18 AC 120 ms
55,820 KB
testcase_19 AC 120 ms
55,828 KB
testcase_20 AC 118 ms
54,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No442_alt2{
	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