結果

問題 No.36 素数が嫌い!
ユーザー papinianuspapinianus
提出日時 2017-01-27 13:40:41
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 254 ms / 5,000 ms
コード長 616 bytes
コンパイル時間 2,208 ms
コンパイル使用メモリ 102,184 KB
実行使用メモリ 23,748 KB
最終ジャッジ日時 2023-09-09 07:46:12
合計ジャッジ時間 7,681 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 149 ms
21,568 KB
testcase_01 AC 210 ms
21,700 KB
testcase_02 AC 57 ms
23,692 KB
testcase_03 AC 58 ms
23,748 KB
testcase_04 AC 57 ms
21,776 KB
testcase_05 AC 58 ms
23,640 KB
testcase_06 AC 58 ms
21,820 KB
testcase_07 AC 58 ms
21,592 KB
testcase_08 AC 58 ms
23,640 KB
testcase_09 AC 57 ms
21,660 KB
testcase_10 AC 58 ms
21,820 KB
testcase_11 AC 121 ms
21,768 KB
testcase_12 AC 254 ms
21,676 KB
testcase_13 AC 253 ms
21,584 KB
testcase_14 AC 180 ms
19,656 KB
testcase_15 AC 56 ms
21,684 KB
testcase_16 AC 57 ms
21,616 KB
testcase_17 AC 56 ms
21,812 KB
testcase_18 AC 56 ms
19,564 KB
testcase_19 AC 134 ms
23,560 KB
testcase_20 AC 254 ms
21,696 KB
testcase_21 AC 207 ms
21,600 KB
testcase_22 AC 212 ms
21,692 KB
testcase_23 AC 150 ms
19,668 KB
testcase_24 AC 163 ms
23,648 KB
testcase_25 AC 161 ms
23,728 KB
testcase_26 AC 179 ms
21,668 KB
testcase_27 AC 228 ms
21,580 KB
testcase_28 AC 176 ms
23,624 KB
testcase_29 AC 247 ms
21,720 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

namespace No36
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = Convert.ToInt64(Console.ReadLine());
            var count = 0;

            foreach (var i in Enumerable.Range(2, Convert.ToInt32(Math.Floor(Math.Sqrt(N)))))
            {
                while((N % i) == 0)
                {
                    N /= i;
                    count++;
                }
            }
            if(N > 1) { count++; }
            if (count > 2) { Console.WriteLine("YES"); }
            else { Console.WriteLine("NO"); }
        }
    }
}
0