結果

問題 No.36 素数が嫌い!
ユーザー tonnnura172tonnnura172
提出日時 2020-05-12 13:26:14
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 1,023 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 87,312 KB
実行使用メモリ 659,064 KB
最終ジャッジ日時 2023-10-11 12:15:45
合計ジャッジ時間 12,120 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 165 ms
80,604 KB
testcase_03 AC 164 ms
80,756 KB
testcase_04 AC 164 ms
80,444 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 MLE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 162 ms
80,692 KB
testcase_16 AC 163 ms
80,704 KB
testcase_17 AC 163 ms
80,068 KB
testcase_18 AC 869 ms
212,624 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd, log
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul, add
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce, lru_cache
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def sieve(n):
	s = [True] * n
	for x in range(2, int(n ** 0.5) + 1):
		if s[x]:
			for i in range(x + x, n, x):
				s[i] = False
	return s

N = INT()
is_prime = sieve(N)

for i in range(2, N):
	if N%i == 0 and not is_prime[i]:
		print("YES")
		break
else:
	print("NO")
0