結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 135 ms
20,784 KB
testcase_02 AC 51 ms
20,864 KB
testcase_03 AC 51 ms
22,752 KB
testcase_04 AC 51 ms
20,920 KB
testcase_05 AC 52 ms
22,844 KB
testcase_06 AC 52 ms
22,684 KB
testcase_07 AC 52 ms
22,788 KB
testcase_08 AC 52 ms
20,692 KB
testcase_09 AC 52 ms
20,808 KB
testcase_10 AC 52 ms
22,664 KB
testcase_11 AC 85 ms
22,772 KB
testcase_12 AC 156 ms
20,908 KB
testcase_13 AC 156 ms
18,812 KB
testcase_14 WA -
testcase_15 AC 52 ms
20,876 KB
testcase_16 AC 51 ms
20,876 KB
testcase_17 AC 50 ms
20,748 KB
testcase_18 AC 51 ms
22,732 KB
testcase_19 AC 92 ms
22,780 KB
testcase_20 AC 156 ms
20,676 KB
testcase_21 AC 131 ms
18,764 KB
testcase_22 AC 135 ms
18,692 KB
testcase_23 AC 101 ms
20,876 KB
testcase_24 AC 108 ms
20,860 KB
testcase_25 WA -
testcase_26 AC 117 ms
20,652 KB
testcase_27 AC 142 ms
18,892 KB
testcase_28 AC 115 ms
20,700 KB
testcase_29 AC 155 ms
20,732 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 <= upper; i++)
        {
            if (n%i == 0)
            {
                primeCount++;
            }
        }
        if (primeCount >= 3)
        {
            Console.WriteLine("YES");
            return;
        }
        Console.WriteLine("NO");        
    }
}
0