結果

問題 No.1665 quotient replace
ユーザー とりゐとりゐ
提出日時 2021-09-04 00:05:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 635 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 82,540 KB
実行使用メモリ 258,180 KB
最終ジャッジ日時 2024-12-15 19:40:48
合計ジャッジ時間 14,858 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 19 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#複数回素因数分解や約数列挙をする場合(n<=10^6)

#エラトステネスの篩
m=10**6
d=[-1]*(m+1)
for i in range(2,m+1):
  if d[i]==-1:
    d[i]=i
    j=2
    while i*j<=m:
      d[i*j]=i
      j+=1
#n の素因数分解
import collections
def fact(n):
  c=0
  while n!=1:
    k=d[n]
    c+=1
    n//=k
  #return c
  return c
#n の約数列挙
def div(n):
  s=set([1])
  while n!=1:
    x=d[n]
    t=s.copy()
    for i in s:
      t.add(i*x)
    n//=x
    s=t.copy()
  return s

n=int(input())
a=list(map(int,input().split()))
cnt=0
xor=0
for i in a:
  xor^=fact(i)
if xor!=1:
  print('white')
else:
  print('black')
0