Submission #10240183


Source Code Expand

Copy
prime = [1 for _ in range(10**6+5)]
prime[0] = 0
prime[1] = 0
for i in range(2,10**3+3):
  if prime[i] == 0:
    continue
  for j in range(2,(10**6+4)//i):
    prime[i*j] = 0
n = int(input())
a = list(map(int,input().split()))
b = 0
c = []
for x in a:
  if x == 7:
    b ^= 3
    #c.append(3)
  elif prime[x-2] == 1:
    b ^= 2
    #c.append(2)
  else:
    b ^= 1
    #c.append(1)
#print(c)
if b == 0:
  print('Ai')
else:
  print('An')
#print(b)

Submission Info

Submission Time
Task D - 素数取りゲーム
User ZOZO
Language PyPy3 (2.4.0)
Score 100
Code Size 472 Byte
Status
Exec Time 338 ms
Memory 114032 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 00_sample_01, 00_sample_02, 00_sample_03
All 100 / 100 00_sample_01, 00_sample_02, 00_sample_03, 01_small_01, 01_small_02, 01_small_03, 01_small_04, 01_small_05, 01_small_06, 02_random_01, 02_random_02, 02_random_03, 02_random_04, 02_random_05, 02_random_06, 02_random_07, 02_random_08, 02_random_09, 02_random_10, 03_large_01, 03_large_02, 03_large_03, 03_large_04, 03_large_05, 03_large_06, 04_large_01, 04_large_02, 04_large_03, 04_large_04, 04_large_05, 04_large_06, 04_large_07, 04_large_08, 04_large_09, 04_large_10
Case Name Status Exec Time Memory
00_sample_01 249 ms 113904 KB
00_sample_02 250 ms 113904 KB
00_sample_03 249 ms 113904 KB
01_small_01 250 ms 113904 KB
01_small_02 251 ms 114032 KB
01_small_03 248 ms 113904 KB
01_small_04 251 ms 113904 KB
01_small_05 249 ms 113904 KB
01_small_06 250 ms 113904 KB
02_random_01 251 ms 113904 KB
02_random_02 254 ms 113904 KB
02_random_03 254 ms 113904 KB
02_random_04 252 ms 113904 KB
02_random_05 252 ms 113904 KB
02_random_06 314 ms 113904 KB
02_random_07 325 ms 113904 KB
02_random_08 313 ms 113904 KB
02_random_09 316 ms 113904 KB
02_random_10 304 ms 113904 KB
03_large_01 331 ms 113904 KB
03_large_02 299 ms 113904 KB
03_large_03 338 ms 113904 KB
03_large_04 338 ms 113904 KB
03_large_05 331 ms 113904 KB
03_large_06 330 ms 114032 KB
04_large_01 326 ms 113904 KB
04_large_02 320 ms 113904 KB
04_large_03 305 ms 113904 KB
04_large_04 322 ms 113904 KB
04_large_05 335 ms 113904 KB
04_large_06 331 ms 113904 KB
04_large_07 327 ms 113904 KB
04_large_08 297 ms 113904 KB
04_large_09 300 ms 113904 KB
04_large_10 322 ms 113904 KB