結果
| 問題 |
No.36 素数が嫌い!
|
| コンテスト | |
| ユーザー |
nbisco
|
| 提出日時 | 2016-04-17 22:00:40 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 349 bytes |
| コンパイル時間 | 113 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-10-04 10:31:28 |
| 合計ジャッジ時間 | 1,843 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 13 WA * 13 |
ソースコード
#!/usr/bin/env python3
#fileencoding: utf-8
from math import sqrt
def isprime(n):
for i in range(3,2,int(sqrt(n))):
if n % i == 0:
return False
return True
N = int(input())
if N == 1:
print("NO")
else:
if N % 2 == 0:
print("YES")
elif isprime(N):
print("YES")
else:
print("NO")
nbisco