結果

問題 No.1113 二つの整数 / Two Integers
ユーザー tentententen
提出日時 2020-08-18 07:05:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 1,000 ms
コード長 526 bytes
コンパイル時間 1,692 ms
コンパイル使用メモリ 74,356 KB
実行使用メモリ 54,176 KB
最終ジャッジ日時 2024-04-20 00:54:06
合計ジャッジ時間 4,314 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
54,016 KB
testcase_01 AC 109 ms
54,176 KB
testcase_02 AC 107 ms
53,928 KB
testcase_03 AC 108 ms
54,124 KB
testcase_04 AC 99 ms
53,100 KB
testcase_05 AC 112 ms
53,976 KB
testcase_06 AC 100 ms
52,976 KB
testcase_07 AC 104 ms
53,120 KB
testcase_08 AC 113 ms
54,092 KB
testcase_09 AC 109 ms
53,964 KB
testcase_10 AC 111 ms
52,980 KB
testcase_11 AC 109 ms
53,208 KB
testcase_12 AC 103 ms
53,104 KB
testcase_13 AC 118 ms
53,948 KB
testcase_14 AC 114 ms
53,820 KB
testcase_15 AC 108 ms
53,460 KB
testcase_16 AC 104 ms
52,840 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();
		long gcd = getGCD(a, b);
		long sqrt = (long)Math.sqrt(gcd);
		if (sqrt * sqrt == gcd) {
		    System.out.println("Odd");
		} else {
		    System.out.println("Even");
		}
    }
    
    static long getGCD(long x, long y) {
        if (x % y == 0) {
            return y;
        } else {
            return getGCD(y, x % y);
        }
    }
    
}

0