結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
![]() |
提出日時 | 2014-11-02 04:17:24 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 543 bytes |
コンパイル時間 | 1,007 ms |
コンパイル使用メモリ | 108,520 KB |
実行使用メモリ | 26,056 KB |
最終ジャッジ日時 | 2024-12-30 16:14:37 |
合計ジャッジ時間 | 4,085 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 WA * 3 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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"); } }