結果
| 問題 |
No.36 素数が嫌い!
|
| コンテスト | |
| ユーザー |
skewes
|
| 提出日時 | 2015-12-30 19:54:50 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 926 bytes |
| コンパイル時間 | 2,459 ms |
| コンパイル使用メモリ | 103,296 KB |
| 実行使用メモリ | 18,048 KB |
| 最終ジャッジ日時 | 2024-09-19 08:48:13 |
| 合計ジャッジ時間 | 3,659 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 25 WA * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
namespace yukicoder
{
class _036
{
static void Main()
{
long n = long.Parse(Console.ReadLine());
int d = 0;
while(n % 2 == 0)
{
d++;
if (d == 2)
{
Console.WriteLine("YES");
return;
}
n /= 2;
}
int i = 3;
while (Math.Pow(i, 3 - d) <= n)
{
if(n % i == 0)
{
d++;
if (d == 2)
{
Console.WriteLine("YES");
return;
}
n /= i;
}
else
{
i += 2;
}
}
Console.WriteLine("NO");
}
}
}
skewes