結果

問題 No.36 素数が嫌い!
ユーザー nanophoto12nanophoto12
提出日時 2014-11-02 04:25:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 154 ms / 5,000 ms
コード長 565 bytes
コンパイル時間 3,028 ms
コンパイル使用メモリ 100,568 KB
実行使用メモリ 22,808 KB
最終ジャッジ日時 2023-09-09 07:04:05
合計ジャッジ時間 6,091 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
20,612 KB
testcase_01 AC 55 ms
22,808 KB
testcase_02 AC 53 ms
20,596 KB
testcase_03 AC 53 ms
22,748 KB
testcase_04 AC 53 ms
20,780 KB
testcase_05 AC 52 ms
20,696 KB
testcase_06 AC 54 ms
20,824 KB
testcase_07 AC 54 ms
18,552 KB
testcase_08 AC 53 ms
20,816 KB
testcase_09 AC 53 ms
20,716 KB
testcase_10 AC 53 ms
20,768 KB
testcase_11 AC 87 ms
22,780 KB
testcase_12 AC 154 ms
20,600 KB
testcase_13 AC 153 ms
18,632 KB
testcase_14 AC 54 ms
20,688 KB
testcase_15 AC 53 ms
20,756 KB
testcase_16 AC 53 ms
22,696 KB
testcase_17 AC 53 ms
22,804 KB
testcase_18 AC 53 ms
20,660 KB
testcase_19 AC 57 ms
20,640 KB
testcase_20 AC 57 ms
20,652 KB
testcase_21 AC 67 ms
20,756 KB
testcase_22 AC 54 ms
20,592 KB
testcase_23 AC 53 ms
20,656 KB
testcase_24 AC 67 ms
20,604 KB
testcase_25 AC 70 ms
20,796 KB
testcase_26 AC 88 ms
20,720 KB
testcase_27 AC 55 ms
20,780 KB
testcase_28 AC 87 ms
20,664 KB
testcase_29 AC 52 ms
18,704 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(string[] args)
    {
        long n = long.Parse(Console.ReadLine());
        int count = 0;
        for (long i = 2; i * i <= n; i++)
        {
            while (n % i == 0)
            {
                n /= i;
                count++;
            }
        }
        if (n > 1)
        {
            count++;            
        }

        if (count >= 3)
        {
            Console.WriteLine("YES");
            return;
        }
        Console.WriteLine("NO");
    }
}
0