結果

問題 No.1665 quotient replace
ユーザー nok0nok0
提出日時 2021-08-11 20:14:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 505 ms / 3,000 ms
コード長 449 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 82,112 KB
実行使用メモリ 264,180 KB
最終ジャッジ日時 2024-12-15 08:48:50
合計ジャッジ時間 11,297 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

spf = [0 for i in range(1000001)]
pr = []
for i in range(2, 1000001):
    if spf[i] == 0:
        spf[i] = i
        pr.append(i)
    j = 0
    while j < len(pr) and pr[j] <= spf[i] and i * pr[j] <= 1000000:
        spf[i * pr[j]] = pr[j]
        j += 1

n = int(input())
a = list(map(int, input().split()))
fold = 0
for v in a:
    cnt = 0
    while v > 1:
        v //= spf[v]
        cnt += 1
    fold ^= cnt

print("white" if fold else "black")
0