結果

問題 No.442 和と積
ユーザー GrenacheGrenache
提出日時 2016-11-11 22:31:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 1,000 ms
コード長 629 bytes
コンパイル時間 3,774 ms
コンパイル使用メモリ 72,408 KB
実行使用メモリ 56,100 KB
最終ジャッジ日時 2023-09-18 06:01:16
合計ジャッジ時間 6,443 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,312 KB
testcase_01 AC 113 ms
56,100 KB
testcase_02 AC 114 ms
55,928 KB
testcase_03 AC 117 ms
55,692 KB
testcase_04 AC 114 ms
55,804 KB
testcase_05 AC 114 ms
55,288 KB
testcase_06 AC 113 ms
55,712 KB
testcase_07 AC 115 ms
55,632 KB
testcase_08 AC 116 ms
55,912 KB
testcase_09 AC 113 ms
55,688 KB
testcase_10 AC 116 ms
53,764 KB
testcase_11 AC 116 ms
55,420 KB
testcase_12 AC 113 ms
55,952 KB
testcase_13 AC 117 ms
55,560 KB
testcase_14 AC 114 ms
55,904 KB
testcase_15 AC 114 ms
55,700 KB
testcase_16 AC 115 ms
55,528 KB
testcase_17 AC 115 ms
55,516 KB
testcase_18 AC 117 ms
55,900 KB
testcase_19 AC 115 ms
55,796 KB
testcase_20 AC 115 ms
55,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


public class Main_yukicoder442 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		BigInteger a = new BigInteger(sc.next());
		BigInteger b = new BigInteger(sc.next());

		pr.println(a.add(b).gcd(a.multiply(b)));
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0