結果

問題 No.1665 quotient replace
ユーザー asumo0729
提出日時 2021-09-03 22:26:48
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 833 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 82,620 KB
実行使用メモリ 241,468 KB
最終ジャッジ日時 2024-12-15 14:36:13
合計ジャッジ時間 6,754 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 1
other AC * 5 RE * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
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)

N = ip()
A = lp()

def factorization(n):
    temp = n
    res = 0
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            
            res += cnt

    if temp!=1:
        res += 1

    if cnt==0:
        res += 1

    return res

Nim = []
for get in A:
    res = factorization(get)
    
    Nim.append(res)

x = 0
for get in Nim:
    x ^= get

if not x:
    print("black")
else:
    print("white")
0