結果

問題 No.36 素数が嫌い!
ユーザー nanophoto12nanophoto12
提出日時 2014-11-02 04:16:37
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 554 bytes
コンパイル時間 3,560 ms
コンパイル使用メモリ 104,100 KB
実行使用メモリ 24,988 KB
最終ジャッジ日時 2023-08-29 00:14:29
合計ジャッジ時間 6,365 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 55 ms
20,624 KB
testcase_03 AC 55 ms
20,908 KB
testcase_04 AC 54 ms
18,880 KB
testcase_05 AC 55 ms
22,936 KB
testcase_06 AC 54 ms
18,868 KB
testcase_07 AC 55 ms
22,788 KB
testcase_08 AC 54 ms
18,680 KB
testcase_09 AC 54 ms
20,820 KB
testcase_10 AC 55 ms
20,808 KB
testcase_11 AC 54 ms
18,752 KB
testcase_12 AC 55 ms
22,780 KB
testcase_13 AC 54 ms
22,744 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 55 ms
20,880 KB
testcase_17 AC 54 ms
22,876 KB
testcase_18 AC 54 ms
22,756 KB
testcase_19 AC 55 ms
20,920 KB
testcase_20 WA -
testcase_21 AC 54 ms
20,800 KB
testcase_22 AC 54 ms
22,840 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 55 ms
20,800 KB
testcase_27 AC 54 ms
20,704 KB
testcase_28 AC 55 ms
22,956 KB
testcase_29 AC 54 ms
20,644 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());
        long upper = (long)Math.Min(Math.Sqrt(n) + 1, n - 1);
        int primeCount = 0;
        for (long i = 2; i <= Math.Sqrt(upper); i++)
        {
            if (n%i == 0)
            {
                primeCount++;
            }
        }
        if (primeCount >= 3)
        {
            Console.WriteLine("YES");
            return;
        }
        Console.WriteLine("NO");        
    }
}
0