結果

問題 No.1665 quotient replace
ユーザー asumo0729asumo0729
提出日時 2021-09-06 10:03:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 546 ms / 3,000 ms
コード長 677 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,252 KB
実行使用メモリ 254,620 KB
最終ジャッジ日時 2023-08-24 05:33:29
合計ジャッジ時間 15,278 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
84,464 KB
testcase_01 AC 110 ms
84,088 KB
testcase_02 AC 111 ms
84,436 KB
testcase_03 AC 115 ms
84,624 KB
testcase_04 AC 115 ms
84,624 KB
testcase_05 AC 111 ms
84,404 KB
testcase_06 AC 126 ms
84,868 KB
testcase_07 AC 112 ms
84,744 KB
testcase_08 AC 113 ms
84,816 KB
testcase_09 AC 121 ms
87,228 KB
testcase_10 AC 253 ms
133,280 KB
testcase_11 AC 408 ms
181,828 KB
testcase_12 AC 157 ms
96,688 KB
testcase_13 AC 525 ms
254,044 KB
testcase_14 AC 546 ms
254,356 KB
testcase_15 AC 512 ms
254,620 KB
testcase_16 AC 507 ms
254,168 KB
testcase_17 AC 509 ms
254,300 KB
testcase_18 AC 111 ms
84,328 KB
testcase_19 AC 112 ms
84,288 KB
testcase_20 AC 115 ms
84,208 KB
testcase_21 AC 115 ms
84,388 KB
testcase_22 AC 111 ms
84,360 KB
testcase_23 AC 112 ms
84,348 KB
testcase_24 AC 111 ms
84,556 KB
testcase_25 AC 113 ms
84,208 KB
testcase_26 AC 116 ms
84,500 KB
testcase_27 AC 119 ms
84,412 KB
testcase_28 AC 123 ms
87,724 KB
testcase_29 AC 135 ms
93,856 KB
testcase_30 AC 236 ms
175,548 KB
testcase_31 AC 297 ms
196,664 KB
testcase_32 AC 394 ms
178,236 KB
testcase_33 AC 223 ms
120,580 KB
testcase_34 AC 344 ms
189,100 KB
testcase_35 AC 323 ms
178,080 KB
testcase_36 AC 341 ms
188,524 KB
testcase_37 AC 312 ms
175,720 KB
testcase_38 AC 342 ms
164,452 KB
testcase_39 AC 273 ms
149,844 KB
testcase_40 AC 267 ms
150,156 KB
testcase_41 AC 269 ms
149,844 KB
testcase_42 AC 116 ms
84,348 KB
testcase_43 AC 123 ms
84,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
stdin=sys.stdin
sys.setrecursionlimit(10 ** 8)

ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
Yp=lambda:print('Yes')
Np=lambda:print('No')
inf = 1 << 60
eps = 1e-9
sortkey = itemgetter(0)

N = ip()
A = lp()

spf = [0 for _ in range(10 ** 6 + 1)]
spf[1] = 1
for i in range(2, 10 ** 6 + 1):
    if spf[i]:
        continue
    for j in range(i, 10 ** 6 + 1, i):
        spf[j] = i

Nim = 0
for i in range(N):
    res = 0
    while A[i] != 1:
        A[i] = A[i] // spf[A[i]]
        res += 1
    Nim ^= res

ans = "white" if Nim else "black"
print(ans)
0