結果
| 問題 | 
                            No.1113 二つの整数 / Two Integers
                             | 
                    
| コンテスト | |
| ユーザー | 
                             tenten
                         | 
                    
| 提出日時 | 2020-08-18 07:05:29 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 132 ms / 1,000 ms | 
| コード長 | 526 bytes | 
| コンパイル時間 | 2,171 ms | 
| コンパイル使用メモリ | 74,184 KB | 
| 実行使用メモリ | 41,448 KB | 
| 最終ジャッジ日時 | 2024-10-11 19:42:42 | 
| 合計ジャッジ時間 | 5,313 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 15 | 
ソースコード
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);
        }
    }
    
}
            
            
            
        
            
tenten