結果

問題 No.442 和と積
ユーザー takeya_okinotakeya_okino
提出日時 2019-08-21 22:01:48
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 322 bytes
コンパイル時間 2,327 ms
コンパイル使用メモリ 74,244 KB
実行使用メモリ 41,540 KB
最終ジャッジ日時 2024-04-18 02:53:56
合計ジャッジ時間 5,795 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 127 ms
41,528 KB
testcase_02 AC 127 ms
40,972 KB
testcase_03 AC 132 ms
41,132 KB
testcase_04 WA -
testcase_05 AC 115 ms
39,816 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 122 ms
40,904 KB
testcase_10 WA -
testcase_11 AC 113 ms
40,060 KB
testcase_12 AC 112 ms
40,156 KB
testcase_13 AC 116 ms
40,124 KB
testcase_14 AC 131 ms
41,540 KB
testcase_15 AC 116 ms
39,848 KB
testcase_16 AC 126 ms
41,220 KB
testcase_17 AC 107 ms
39,600 KB
testcase_18 WA -
testcase_19 AC 127 ms
40,880 KB
testcase_20 AC 133 ms
41,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long a = sc.nextLong();
    long b = sc.nextLong();
    System.out.println(gcd(a, b));
  }

  public static long gcd(long a, long b) {
    if(b == 0) return a;
    return gcd(b, (a % b));
  }
}
0