結果

問題 No.1665 quotient replace
ユーザー brthyyjpbrthyyjp
提出日時 2021-09-16 14:26:05
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 585 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 173,084 KB
最終ジャッジ日時 2024-06-29 14:23:44
合計ジャッジ時間 11,312 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 TLE * 2 -- * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
def factorize(n):
    d = {}
    temp = int(math.sqrt(n))+1
    for i in range(2, temp):
        while n%i== 0:
            n //= i
            if i in d:
                d[i] += 1
            else:
                d[i] = 1
    if d == {}:
        d[n] = 1
    else:
        if n in d:
            d[n] += 1
        elif n != 1:
            d[n] =1
    return d

n = int(input())
A = list(map(int, input().split()))
t = 0
for a in A:
    d = factorize(a)
    c = 0
    for k, v in d.items():
        c += v
    t ^= c
if t == 0:
    print('black')
else:
    print('white')
0