QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#380533 | #8508. DiviDuelo | Ganny | WA | 9ms | 9680kb | Python3 | 567b | 2024-04-07 05:34:27 | 2024-04-07 05:34:27 |
Judging History
answer
import math
def is_prime(n):
if n <= 1:
return False
if n <= 3:
return True
if n % 2 == 0 or n % 3 == 0:
return False
i = 5
while i * i <= n:
if n % i == 0 or n % (i + 2) == 0:
return False
i += 6
return True
def can_starting_player_win(N):
if N % 2 == 0:
return True
else:
return not is_prime(N)
# Read input
N = int(input())
# Check if the starting player can win
if can_starting_player_win(N):
print("Y")
else:
print("N")
詳細信息
Test #1:
score: 100
Accepted
time: 6ms
memory: 9616kb
input:
10
output:
Y
result:
ok "Y"
Test #2:
score: -100
Wrong Answer
time: 9ms
memory: 9680kb
input:
9
output:
Y
result:
wrong answer 1st words differ - expected: 'N', found: 'Y'