結果

問題 No.442 和と積
ユーザー ieneko18ieneko18
提出日時 2016-11-12 19:47:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 1,000 ms
コード長 320 bytes
コンパイル時間 1,984 ms
コンパイル使用メモリ 71,728 KB
実行使用メモリ 56,308 KB
最終ジャッジ日時 2023-09-18 06:28:03
合計ジャッジ時間 5,663 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
56,032 KB
testcase_01 AC 127 ms
56,024 KB
testcase_02 AC 125 ms
55,892 KB
testcase_03 AC 124 ms
55,636 KB
testcase_04 AC 123 ms
56,300 KB
testcase_05 AC 130 ms
56,144 KB
testcase_06 AC 124 ms
56,080 KB
testcase_07 AC 124 ms
55,872 KB
testcase_08 AC 129 ms
55,628 KB
testcase_09 AC 127 ms
56,020 KB
testcase_10 AC 126 ms
55,932 KB
testcase_11 AC 124 ms
56,308 KB
testcase_12 AC 124 ms
55,868 KB
testcase_13 AC 121 ms
56,152 KB
testcase_14 AC 126 ms
56,008 KB
testcase_15 AC 126 ms
55,628 KB
testcase_16 AC 125 ms
55,880 KB
testcase_17 AC 126 ms
55,664 KB
testcase_18 AC 125 ms
56,148 KB
testcase_19 AC 126 ms
55,836 KB
testcase_20 AC 130 ms
55,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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 s=a.add(b);
		BigInteger p=a.multiply(b);
		System.out.println(s.gcd(p));
	}
}
0