結果

問題 No.36 素数が嫌い!
ユーザー No
提出日時 2018-01-27 14:08:44
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 509 bytes
コンパイル時間 948 ms
コンパイル使用メモリ 111,340 KB
実行使用メモリ 26,060 KB
最終ジャッジ日時 2024-12-29 06:38:12
合計ジャッジ時間 4,113 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 12 WA * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
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