結果

問題 No.1113 二つの整数 / Two Integers
ユーザー bluemeganebluemegane
提出日時 2020-09-12 16:02:39
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 1,000 ms
コード長 652 bytes
コンパイル時間 1,839 ms
コンパイル使用メモリ 61,108 KB
実行使用メモリ 22,908 KB
最終ジャッジ日時 2023-08-30 14:37:19
合計ジャッジ時間 4,319 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,652 KB
testcase_01 AC 55 ms
18,584 KB
testcase_02 AC 56 ms
22,736 KB
testcase_03 AC 55 ms
20,812 KB
testcase_04 AC 55 ms
22,908 KB
testcase_05 AC 55 ms
20,688 KB
testcase_06 AC 55 ms
22,708 KB
testcase_07 AC 56 ms
20,836 KB
testcase_08 AC 56 ms
20,692 KB
testcase_09 AC 55 ms
20,864 KB
testcase_10 AC 55 ms
18,704 KB
testcase_11 AC 55 ms
18,676 KB
testcase_12 AC 56 ms
22,804 KB
testcase_13 AC 56 ms
22,708 KB
testcase_14 AC 55 ms
20,776 KB
testcase_15 AC 56 ms
20,780 KB
testcase_16 AC 55 ms
20,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using static System.Math;
using System;

public class Hello
{
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = long.Parse(line[0]);
        var b = long.Parse(line[1]);
        var c = Gcd(a, b);
        Console.WriteLine(check(c) ? "Odd" : "Even");
    }
    static bool check(long a)
    {
        var t = (long)Sqrt(a);
        return t * t == a | (t + 1) * (t + 1) == a;
    }
    static long Gcd(long a, long b)
    {
        if (a < b) return Gcd(b, a);
        while (b != 0)
        {
            var w = a % b;
            a = b;
            b = w;
        }
        return a;
    }
}
0