結果

問題 No.1113 二つの整数 / Two Integers
ユーザー ks2mks2m
提出日時 2020-07-17 21:22:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 1,000 ms
コード長 493 bytes
コンパイル時間 3,585 ms
コンパイル使用メモリ 72,080 KB
実行使用メモリ 56,096 KB
最終ジャッジ日時 2023-08-20 05:58:59
合計ジャッジ時間 6,154 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,752 KB
testcase_01 AC 124 ms
55,960 KB
testcase_02 AC 126 ms
55,976 KB
testcase_03 AC 123 ms
55,928 KB
testcase_04 AC 123 ms
55,844 KB
testcase_05 AC 124 ms
53,940 KB
testcase_06 AC 123 ms
55,528 KB
testcase_07 AC 125 ms
55,964 KB
testcase_08 AC 127 ms
53,792 KB
testcase_09 AC 124 ms
55,728 KB
testcase_10 AC 123 ms
55,788 KB
testcase_11 AC 122 ms
55,804 KB
testcase_12 AC 123 ms
56,096 KB
testcase_13 AC 121 ms
55,484 KB
testcase_14 AC 124 ms
55,848 KB
testcase_15 AC 127 ms
55,792 KB
testcase_16 AC 128 ms
55,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();

		long g = gcd(a, b);
		long s = (long) Math.sqrt(g) - 10;
		for (long i = s; i < s + 20; i++) {
			if (i * i == g) {
				System.out.println("Odd");
				return;
			}
		}
		System.out.println("Even");
	}

	static long gcd(long a, long b) {
		return b == 0 ? a : gcd(b, a % b);
	}
}
0