結果

問題 No.1665 quotient replace
ユーザー asumo0729asumo0729
提出日時 2021-09-14 16:57:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 476 ms / 3,000 ms
コード長 748 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 82,252 KB
実行使用メモリ 250,844 KB
最終ジャッジ日時 2024-06-27 07:26:18
合計ジャッジ時間 10,622 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
from collections import defaultdict, deque
import heapq
import bisect
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)

Max = 10 ** 6 + 10
N = ip()
A = lp()

spf = [0 for _ in range(Max)]

for i in range(2, Max):
    if spf[i] != 0:
        continue
    for j in range(i, Max, i):
        spf[j] = i

Xor = 0
for get in A:
    res = 0
    while get != 1:
        now = spf[get]
        res += 1
        get //= now
    Xor ^= res

if Xor:
    print("white")
else:
    print("black")
0