結果

問題 No.1113 二つの整数 / Two Integers
ユーザー hoshiikahoshiika
提出日時 2020-07-17 21:27:39
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,105 bytes
コンパイル時間 844 ms
コンパイル使用メモリ 113,048 KB
実行使用メモリ 35,312 KB
最終ジャッジ日時 2024-05-07 06:47:59
合計ジャッジ時間 5,296 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using static System.Console;
using static System.Math;
using System.Numerics;
using System.Collections.Generic;
using System.Linq;


namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //var s = Conasole.ReadLine().Split(' ')
            var s = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
            long gcd = Gcd(s[0], s[1]);
            long root = (long)Sqrt(gcd);
            var ans = 1;
            while (gcd > 1)
            {
                for (int i = 2; i < root; i++)
                {
                    if (gcd % i == 0)
                    {
                        gcd /= i;
                        ans++;
                        break;
                    }
                }
            }
            string str = "Event";
            if (ans % 2 == 1)
            {
                str = "Odd";
            }
            WriteLine(str);
            Out.Flush();
        }
        public static long Gcd(long n, long m)
        { return n % m == 0 ? m : Gcd(m, n % m); }


    }



}
0