結果

問題 No.1665 quotient replace
ユーザー brthyyjpbrthyyjp
提出日時 2021-09-16 14:27:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,007 ms / 3,000 ms
コード長 613 bytes
コンパイル時間 504 ms
コンパイル使用メモリ 86,776 KB
実行使用メモリ 266,736 KB
最終ジャッジ日時 2023-09-12 01:19:50
合計ジャッジ時間 19,578 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 147 ms
91,572 KB
testcase_01 AC 139 ms
91,612 KB
testcase_02 AC 140 ms
91,808 KB
testcase_03 AC 152 ms
92,208 KB
testcase_04 AC 151 ms
92,460 KB
testcase_05 AC 143 ms
91,564 KB
testcase_06 AC 160 ms
93,412 KB
testcase_07 AC 159 ms
92,548 KB
testcase_08 AC 157 ms
92,508 KB
testcase_09 AC 182 ms
95,952 KB
testcase_10 AC 431 ms
150,064 KB
testcase_11 AC 768 ms
199,884 KB
testcase_12 AC 250 ms
104,928 KB
testcase_13 AC 986 ms
266,352 KB
testcase_14 AC 1,007 ms
266,448 KB
testcase_15 AC 962 ms
266,648 KB
testcase_16 AC 936 ms
266,648 KB
testcase_17 AC 941 ms
266,736 KB
testcase_18 AC 153 ms
91,548 KB
testcase_19 AC 148 ms
91,412 KB
testcase_20 AC 145 ms
91,684 KB
testcase_21 AC 150 ms
91,852 KB
testcase_22 AC 150 ms
91,504 KB
testcase_23 AC 146 ms
91,620 KB
testcase_24 AC 146 ms
91,564 KB
testcase_25 AC 139 ms
91,680 KB
testcase_26 AC 151 ms
92,596 KB
testcase_27 AC 151 ms
92,520 KB
testcase_28 AC 163 ms
96,248 KB
testcase_29 AC 182 ms
101,764 KB
testcase_30 AC 398 ms
185,236 KB
testcase_31 AC 524 ms
213,640 KB
testcase_32 AC 716 ms
197,940 KB
testcase_33 AC 385 ms
133,908 KB
testcase_34 AC 603 ms
186,552 KB
testcase_35 AC 595 ms
186,316 KB
testcase_36 AC 593 ms
186,960 KB
testcase_37 AC 575 ms
185,204 KB
testcase_38 AC 650 ms
176,124 KB
testcase_39 AC 504 ms
171,136 KB
testcase_40 AC 504 ms
171,076 KB
testcase_41 AC 499 ms
171,364 KB
testcase_42 AC 149 ms
91,548 KB
testcase_43 AC 146 ms
91,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = 2*10**6
spf = [-1]*(N+1)
for i in range(N+1):
    spf[i] = i
for i in range(2, int(math.sqrt(N))+1):
    if spf[i] == i:
        for j in range(i*2, N+1, i):
            if spf[j] == j:
                spf[j] = i

def factorize(n):
    d = {}
    while n != 1:
        p = spf[n]
        if p in d:
            d[p] += 1
        else:
            d[p] = 1
        n //= p
    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