結果

問題 No.1665 quotient replace
ユーザー とりゐとりゐ
提出日時 2021-09-04 00:05:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 568 ms / 3,000 ms
コード長 635 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 247,616 KB
最終ジャッジ日時 2023-08-22 02:36:30
合計ジャッジ時間 13,613 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
85,004 KB
testcase_01 AC 118 ms
84,804 KB
testcase_02 AC 120 ms
84,984 KB
testcase_03 AC 124 ms
85,264 KB
testcase_04 AC 124 ms
85,028 KB
testcase_05 AC 122 ms
84,988 KB
testcase_06 AC 131 ms
85,840 KB
testcase_07 AC 129 ms
85,876 KB
testcase_08 AC 126 ms
85,672 KB
testcase_09 AC 142 ms
88,824 KB
testcase_10 AC 286 ms
128,060 KB
testcase_11 AC 467 ms
215,800 KB
testcase_12 AC 166 ms
97,772 KB
testcase_13 AC 568 ms
247,036 KB
testcase_14 AC 559 ms
246,552 KB
testcase_15 AC 565 ms
247,616 KB
testcase_16 AC 558 ms
246,576 KB
testcase_17 AC 559 ms
246,340 KB
testcase_18 AC 118 ms
84,916 KB
testcase_19 AC 119 ms
85,012 KB
testcase_20 AC 121 ms
85,032 KB
testcase_21 AC 120 ms
84,952 KB
testcase_22 AC 121 ms
84,876 KB
testcase_23 AC 121 ms
84,952 KB
testcase_24 AC 122 ms
85,004 KB
testcase_25 AC 121 ms
85,172 KB
testcase_26 AC 129 ms
85,660 KB
testcase_27 AC 127 ms
85,728 KB
testcase_28 AC 139 ms
89,492 KB
testcase_29 AC 149 ms
94,808 KB
testcase_30 AC 295 ms
162,832 KB
testcase_31 AC 357 ms
182,984 KB
testcase_32 AC 443 ms
213,116 KB
testcase_33 AC 248 ms
130,740 KB
testcase_34 AC 379 ms
179,012 KB
testcase_35 AC 366 ms
166,044 KB
testcase_36 AC 369 ms
176,180 KB
testcase_37 AC 346 ms
162,980 KB
testcase_38 AC 393 ms
191,996 KB
testcase_39 AC 317 ms
147,040 KB
testcase_40 AC 323 ms
147,052 KB
testcase_41 AC 322 ms
146,856 KB
testcase_42 AC 120 ms
85,168 KB
testcase_43 AC 120 ms
85,084 KB
権限があれば一括ダウンロードができます

ソースコード

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!=0:
  print('white')
else:
  print('black')
0