結果

問題 No.1665 quotient replace
ユーザー shiroha_F14shiroha_F14
提出日時 2021-08-11 20:54:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 546 ms / 3,000 ms
コード長 400 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 258,244 KB
最終ジャッジ日時 2023-08-21 18:55:17
合計ジャッジ時間 13,683 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
84,120 KB
testcase_01 AC 109 ms
83,972 KB
testcase_02 AC 111 ms
84,168 KB
testcase_03 AC 112 ms
84,336 KB
testcase_04 AC 115 ms
84,444 KB
testcase_05 AC 108 ms
83,928 KB
testcase_06 AC 117 ms
84,580 KB
testcase_07 AC 117 ms
84,596 KB
testcase_08 AC 117 ms
84,536 KB
testcase_09 AC 124 ms
87,516 KB
testcase_10 AC 245 ms
132,688 KB
testcase_11 AC 383 ms
186,392 KB
testcase_12 AC 148 ms
97,700 KB
testcase_13 AC 546 ms
257,120 KB
testcase_14 AC 546 ms
258,244 KB
testcase_15 AC 511 ms
258,140 KB
testcase_16 AC 510 ms
258,024 KB
testcase_17 AC 521 ms
258,148 KB
testcase_18 AC 112 ms
84,156 KB
testcase_19 AC 108 ms
84,300 KB
testcase_20 AC 112 ms
84,148 KB
testcase_21 AC 108 ms
84,156 KB
testcase_22 AC 108 ms
84,036 KB
testcase_23 AC 107 ms
84,120 KB
testcase_24 AC 112 ms
84,188 KB
testcase_25 AC 116 ms
84,348 KB
testcase_26 AC 116 ms
84,592 KB
testcase_27 AC 118 ms
84,640 KB
testcase_28 AC 123 ms
88,028 KB
testcase_29 AC 132 ms
94,204 KB
testcase_30 AC 236 ms
162,184 KB
testcase_31 AC 309 ms
204,332 KB
testcase_32 AC 366 ms
180,732 KB
testcase_33 AC 223 ms
117,812 KB
testcase_34 AC 342 ms
186,180 KB
testcase_35 AC 320 ms
176,280 KB
testcase_36 AC 339 ms
183,736 KB
testcase_37 AC 312 ms
162,072 KB
testcase_38 AC 367 ms
198,764 KB
testcase_39 AC 287 ms
150,816 KB
testcase_40 AC 294 ms
150,668 KB
testcase_41 AC 293 ms
150,620 KB
testcase_42 AC 117 ms
84,036 KB
testcase_43 AC 114 ms
83,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

spl = [0 for _ in range(1000001)]
spl[1] = 1
for i in range(2, 1000001):
  if spl[i] : continue;
  for j in range(i, 1000001, i):
    spl[j] = i

grundy = [0 for _ in range(n)]
for i in range(n):
  while a[i] > 1:
    a[i] //= spl[a[i]]
    grundy[i] += 1

nimber = 0
for i in range(n):
  nimber ^= grundy[i]
print("white" if nimber else "black")
0