結果

問題 No.1665 quotient replace
ユーザー とりゐとりゐ
提出日時 2021-09-03 21:38:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 644 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 82,536 KB
実行使用メモリ 258,252 KB
最終ジャッジ日時 2024-12-15 10:59:55
合計ジャッジ時間 10,836 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 18
権限があれば一括ダウンロードができます

ソースコード

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
for i in a:
  if fact(i)!=1:
    cnt+=1
if cnt%2==1:
  print('white')
else:
  print('black')
0