結果

問題 No.1665 quotient replace
ユーザー ntudantuda
提出日時 2021-09-04 13:09:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,059 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 272,940 KB
最終ジャッジ日時 2024-05-10 02:06:54
合計ジャッジ時間 49,128 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,480 KB
testcase_01 AC 40 ms
51,840 KB
testcase_02 AC 40 ms
52,224 KB
testcase_03 AC 890 ms
255,416 KB
testcase_04 AC 899 ms
255,364 KB
testcase_05 AC 852 ms
254,208 KB
testcase_06 AC 915 ms
257,408 KB
testcase_07 AC 877 ms
256,000 KB
testcase_08 AC 883 ms
256,640 KB
testcase_09 AC 916 ms
258,932 KB
testcase_10 AC 1,253 ms
259,452 KB
testcase_11 AC 1,780 ms
259,952 KB
testcase_12 AC 1,001 ms
259,116 KB
testcase_13 AC 2,131 ms
270,504 KB
testcase_14 AC 2,235 ms
270,368 KB
testcase_15 AC 2,072 ms
270,636 KB
testcase_16 AC 1,985 ms
270,888 KB
testcase_17 AC 2,032 ms
271,004 KB
testcase_18 AC 434 ms
180,224 KB
testcase_19 AC 258 ms
134,912 KB
testcase_20 AC 491 ms
194,432 KB
testcase_21 AC 538 ms
205,056 KB
testcase_22 AC 313 ms
150,272 KB
testcase_23 AC 685 ms
238,592 KB
testcase_24 AC 439 ms
180,352 KB
testcase_25 AC 309 ms
150,144 KB
testcase_26 AC 875 ms
256,384 KB
testcase_27 AC 881 ms
257,408 KB
testcase_28 AC 884 ms
259,104 KB
testcase_29 AC 897 ms
258,412 KB
testcase_30 AC 991 ms
268,380 KB
testcase_31 AC 1,126 ms
259,216 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