結果

問題 No.103 素因数ゲーム リターンズ
ユーザー あかりきあかりき
提出日時 2021-05-04 19:19:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 557 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 86,700 KB
実行使用メモリ 77,392 KB
最終ジャッジ日時 2023-09-30 20:45:51
合計ジャッジ時間 4,329 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
76,872 KB
testcase_01 AC 113 ms
77,088 KB
testcase_02 AC 117 ms
77,076 KB
testcase_03 AC 115 ms
77,392 KB
testcase_04 AC 112 ms
77,144 KB
testcase_05 AC 112 ms
77,096 KB
testcase_06 AC 112 ms
77,004 KB
testcase_07 AC 113 ms
77,292 KB
testcase_08 AC 113 ms
77,304 KB
testcase_09 AC 112 ms
77,024 KB
testcase_10 AC 112 ms
77,160 KB
testcase_11 AC 112 ms
77,032 KB
testcase_12 AC 112 ms
77,024 KB
testcase_13 AC 113 ms
77,248 KB
testcase_14 AC 113 ms
76,972 KB
testcase_15 AC 113 ms
77,160 KB
testcase_16 AC 111 ms
77,152 KB
testcase_17 AC 113 ms
77,248 KB
testcase_18 AC 114 ms
76,876 KB
testcase_19 AC 113 ms
77,028 KB
testcase_20 AC 113 ms
77,008 KB
testcase_21 AC 114 ms
77,088 KB
testcase_22 AC 113 ms
77,084 KB
testcase_23 AC 113 ms
77,028 KB
testcase_24 AC 115 ms
77,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
m=list(map(int,input().split()))

def fact(n):
  fct=[]
  b,e=2,0
  while b*b<=n:
    while n%b==0:
      n=n//b
      e=e+1
    if e>0:
      fct.append((b,e))
    b,e=b+1,0
  if n>1:
    fct.append((n,1))
  return fct

g=[0]*(10**4+1)
g[1]=0
for i in range(2,10**4+1):
  L=[0]*100
  f=fact(i)
  for j in range(len(f)):
    L[g[i//f[j][0]]]=1
    if f[j][1]>1:
      L[g[i//(f[j][0]**2)]]=1
  for j in range(len(L)):
    if L[j]==0:
      g[i]=j
      break

x=0
for i in range(n):
  x^=g[m[i]]
if x==0:
  print('Bob')
else:
  print('Alice')
0