結果

問題 No.36 素数が嫌い!
ユーザー NoNo
提出日時 2018-01-27 14:08:44
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 509 bytes
コンパイル時間 1,885 ms
コンパイル使用メモリ 102,588 KB
実行使用メモリ 22,780 KB
最終ジャッジ日時 2023-08-28 09:49:42
合計ジャッジ時間 5,936 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 51 ms
18,568 KB
testcase_04 AC 52 ms
20,760 KB
testcase_05 AC 51 ms
18,640 KB
testcase_06 AC 52 ms
22,660 KB
testcase_07 AC 52 ms
22,772 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 88 ms
20,552 KB
testcase_12 AC 163 ms
20,616 KB
testcase_13 AC 163 ms
22,704 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 52 ms
22,732 KB
testcase_17 AC 51 ms
20,684 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 121 ms
22,728 KB
testcase_27 AC 147 ms
20,776 KB
testcase_28 AC 119 ms
20,668 KB
testcase_29 AC 163 ms
22,672 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 && i == n)
                {
                    f = true;
                    break;
                }
            }

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