結果

問題 No.1665 quotient replace
ユーザー ntudantuda
提出日時 2021-09-04 13:09:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,059 bytes
コンパイル時間 1,412 ms
コンパイル使用メモリ 85,924 KB
実行使用メモリ 273,552 KB
最終ジャッジ日時 2023-08-22 20:28:49
合計ジャッジ時間 52,708 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
71,640 KB
testcase_01 AC 88 ms
71,252 KB
testcase_02 AC 84 ms
71,600 KB
testcase_03 AC 1,054 ms
257,132 KB
testcase_04 AC 951 ms
257,768 KB
testcase_05 AC 931 ms
257,596 KB
testcase_06 AC 980 ms
259,792 KB
testcase_07 AC 965 ms
258,136 KB
testcase_08 AC 945 ms
258,356 KB
testcase_09 AC 981 ms
259,584 KB
testcase_10 AC 1,313 ms
261,124 KB
testcase_11 AC 1,795 ms
258,560 KB
testcase_12 AC 1,020 ms
260,096 KB
testcase_13 AC 2,087 ms
273,432 KB
testcase_14 AC 2,206 ms
273,248 KB
testcase_15 AC 2,084 ms
273,232 KB
testcase_16 AC 2,071 ms
273,552 KB
testcase_17 AC 2,092 ms
273,520 KB
testcase_18 AC 471 ms
176,820 KB
testcase_19 AC 284 ms
133,328 KB
testcase_20 AC 527 ms
190,308 KB
testcase_21 AC 570 ms
199,952 KB
testcase_22 AC 344 ms
147,820 KB
testcase_23 AC 715 ms
231,708 KB
testcase_24 AC 468 ms
176,932 KB
testcase_25 AC 341 ms
147,596 KB
testcase_26 AC 924 ms
258,512 KB
testcase_27 AC 915 ms
257,944 KB
testcase_28 AC 917 ms
258,940 KB
testcase_29 AC 928 ms
259,700 KB
testcase_30 AC 1,060 ms
270,524 KB
testcase_31 AC 1,189 ms
257,828 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 RE -
testcase_43 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

def seachPrimeNum(N):
    max = int(N**0.5)
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

def adic(dic,x):
    if x in dic:
        dic[x] += 1
    else:
        dic[x] = 1
    return

def factorization(x):
    dic = {}
    for p in PL:
        if x in PL:
            adic(dic,x)
            return dic
        while x % p == 0:
            adic(dic,p)
            x //= p
        if x == 1:
            return dic
    # ここには来ないはず
    print("factorization error")
    return "error"

# 約数の数
def N_divisors(x):
    dic = factorization(x)
    ret = 1
    for v in dic.values():
        ret *= (v+1)
    return ret

N = int(input())
A = list(map(int,input().split()))
PL = set(seachPrimeNum(max(A)))
G = 0
for i in range(N):
    G ^= (N_divisors(A[i]) - 1)

if G == 0:
    print("black")
else:
    print("white")

0