結果

問題 No.36 素数が嫌い!
ユーザー NoNo
提出日時 2018-01-27 14:04:55
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 3,608 ms
コンパイル使用メモリ 99,344 KB
実行使用メモリ 24,788 KB
最終ジャッジ日時 2023-08-28 09:49:32
合計ジャッジ時間 6,899 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
20,776 KB
testcase_01 AC 51 ms
20,728 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 52 ms
20,744 KB
testcase_08 AC 51 ms
20,684 KB
testcase_09 AC 52 ms
20,620 KB
testcase_10 AC 52 ms
20,772 KB
testcase_11 AC 87 ms
20,608 KB
testcase_12 AC 162 ms
20,716 KB
testcase_13 WA -
testcase_14 AC 51 ms
20,772 KB
testcase_15 AC 51 ms
20,688 KB
testcase_16 AC 51 ms
20,680 KB
testcase_17 AC 51 ms
20,680 KB
testcase_18 AC 52 ms
20,820 KB
testcase_19 AC 52 ms
20,688 KB
testcase_20 AC 51 ms
20,668 KB
testcase_21 AC 52 ms
18,720 KB
testcase_22 AC 53 ms
22,792 KB
testcase_23 AC 52 ms
20,664 KB
testcase_24 AC 54 ms
22,864 KB
testcase_25 AC 53 ms
20,772 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = long.Parse(Console.ReadLine());
            int e = (int)Math.Sqrt(n) + 1;
            bool f = false;

            for (int i = 2; i <= e; i++)
            {
                if (n % i == 0)
                {
                    f = true;
                    break;
                }
            }

            Console.WriteLine(f && n != 1 ? "YES" : "NO");
        }
    }
}
0