結果

問題 No.36 素数が嫌い!
ユーザー しらゆきしらゆき
提出日時 2015-11-23 14:43:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 154 ms / 5,000 ms
コード長 428 bytes
コンパイル時間 3,543 ms
コンパイル使用メモリ 103,140 KB
実行使用メモリ 22,744 KB
最終ジャッジ日時 2023-09-09 07:25:25
合計ジャッジ時間 6,429 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
20,588 KB
testcase_01 AC 55 ms
18,660 KB
testcase_02 AC 52 ms
20,616 KB
testcase_03 AC 53 ms
20,584 KB
testcase_04 AC 53 ms
22,688 KB
testcase_05 AC 53 ms
20,744 KB
testcase_06 AC 53 ms
22,688 KB
testcase_07 AC 53 ms
22,724 KB
testcase_08 AC 53 ms
20,632 KB
testcase_09 AC 53 ms
20,696 KB
testcase_10 AC 53 ms
20,692 KB
testcase_11 AC 87 ms
20,688 KB
testcase_12 AC 154 ms
20,580 KB
testcase_13 AC 152 ms
20,700 KB
testcase_14 AC 53 ms
22,644 KB
testcase_15 AC 53 ms
20,536 KB
testcase_16 AC 53 ms
22,628 KB
testcase_17 AC 54 ms
18,636 KB
testcase_18 AC 53 ms
20,648 KB
testcase_19 AC 58 ms
22,572 KB
testcase_20 AC 57 ms
22,720 KB
testcase_21 AC 66 ms
20,664 KB
testcase_22 AC 54 ms
20,568 KB
testcase_23 AC 54 ms
22,744 KB
testcase_24 AC 68 ms
20,620 KB
testcase_25 AC 72 ms
22,680 KB
testcase_26 AC 89 ms
22,656 KB
testcase_27 AC 58 ms
20,696 KB
testcase_28 AC 88 ms
22,632 KB
testcase_29 AC 54 ms
20,668 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program
{
    public static void Main()
    {
        long n = long.Parse(Console.ReadLine());

        int cnt = 0;
        for (long i = 2; i * i <= n; i++)
        {
            while (n % i == 0)
            {
                n /= i;
                cnt++;
            }
        }

        if (n != 1) cnt++;

        if (cnt >= 3) Console.WriteLine("YES");
        else Console.WriteLine("NO");
    }
}
0