結果

問題 No.2379 Burnside's Theorem
ユーザー bluemeganebluemegane
提出日時 2023-07-14 22:21:06
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 697 bytes
コンパイル時間 2,598 ms
コンパイル使用メモリ 62,996 KB
実行使用メモリ 22,728 KB
最終ジャッジ日時 2023-10-14 12:36:51
合計ジャッジ時間 4,079 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
20,644 KB
testcase_01 AC 52 ms
22,728 KB
testcase_02 AC 53 ms
20,596 KB
testcase_03 AC 51 ms
20,780 KB
testcase_04 AC 51 ms
20,700 KB
testcase_05 AC 52 ms
20,784 KB
testcase_06 AC 51 ms
20,708 KB
testcase_07 AC 50 ms
20,624 KB
testcase_08 AC 51 ms
18,648 KB
testcase_09 AC 52 ms
20,728 KB
testcase_10 AC 54 ms
18,600 KB
testcase_11 AC 49 ms
20,652 KB
testcase_12 AC 49 ms
20,676 KB
testcase_13 AC 54 ms
20,724 KB
testcase_14 AC 56 ms
20,776 KB
testcase_15 AC 60 ms
20,660 KB
testcase_16 AC 51 ms
22,716 KB
testcase_17 AC 51 ms
20,788 KB
testcase_18 AC 51 ms
20,776 KB
testcase_19 AC 50 ms
22,652 KB
testcase_20 AC 49 ms
20,680 KB
testcase_21 AC 49 ms
20,760 KB
testcase_22 AC 51 ms
20,672 KB
testcase_23 AC 51 ms
20,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System.Collections.Generic;
using System;

public class Hello
{
    static void Main()
    {
        var n = long.Parse(Console.ReadLine().Trim());
        getAns(n);
    }
    static void getAns(long n)
    {
        var d = PF(n);
        Console.WriteLine(d.Count <=2? "Yes":"No");
    }
    static Dictionary<long, int> PF(long n)
    {
        var d = new Dictionary<long, int>();
        for (long i = 2; i * i <= n; i++)
        {
            if (n % i != 0) continue;
            var x = 0;
            while (n % i == 0)
            {
                x++;
                n /= i;
            }
            d[i] = x;
        }
        if (n != 1) d[n] = 1;
        return d;
    }
}
0