結果

問題 No.1665 quotient replace
ユーザー minimum
提出日時 2021-09-04 13:24:02
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 554 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 82,040 KB
実行使用メモリ 280,384 KB
最終ジャッジ日時 2024-12-17 22:33:30
合計ジャッジ時間 114,510 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 TLE * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

# 素数列挙
mx = 10 ** 6
isprime = [True] * (mx + 1)
prime_list = []
isprime[0], isprime[1] = False, False
for i in range(2, mx):
    if isprime[i] == False:
        continue
    prime_list.append(i)
    j = 2 * i
    while j <= mx:
        isprime[j] = False
        j += i

#素因数分解
cnt = [0] * N
for p in prime_list:
    for i in range(N):
        while A[i] % p == 0:
            cnt[i] += 1
            A[i] //= p

# XOR
x = 0
for c in cnt:
    x ^= c
print(["black", "white"][x > 0])
0