結果
問題 | No.442 和と積 |
ユーザー |
|
提出日時 | 2017-02-13 07:29:36 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 137 ms / 1,000 ms |
コード長 | 626 bytes |
コンパイル時間 | 3,558 ms |
コンパイル使用メモリ | 73,788 KB |
実行使用メモリ | 54,208 KB |
最終ジャッジ日時 | 2024-07-04 23:03:15 |
合計ジャッジ時間 | 6,940 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
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);}}