結果

問題 No.1665 quotient replace
ユーザー NatsubiSogan
提出日時 2021-09-03 21:41:17
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 450 bytes
コンパイル時間 524 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 245,568 KB
最終ジャッジ日時 2024-12-15 11:21:31
合計ジャッジ時間 30,047 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

n = int(input())
a = list(map(int, input().split()))
b = []
for i in a:
	b.append(len(prime_factorize(i)))
ans = 0
for i in b:
	ans ^= i
print("black" if ans == 0 else "white")
0