結果

問題 No.1665 quotient replace
ユーザー hir355hir355
提出日時 2021-09-03 21:31:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 658 ms / 3,000 ms
コード長 1,141 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 82,448 KB
実行使用メモリ 253,372 KB
最終ジャッジ日時 2024-05-09 02:00:48
合計ジャッジ時間 12,435 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
67,236 KB
testcase_01 AC 61 ms
67,112 KB
testcase_02 AC 64 ms
68,060 KB
testcase_03 AC 64 ms
69,248 KB
testcase_04 AC 67 ms
71,020 KB
testcase_05 AC 65 ms
67,920 KB
testcase_06 AC 77 ms
77,852 KB
testcase_07 AC 71 ms
71,180 KB
testcase_08 AC 74 ms
74,672 KB
testcase_09 AC 92 ms
86,576 KB
testcase_10 AC 274 ms
129,480 KB
testcase_11 AC 480 ms
175,520 KB
testcase_12 AC 123 ms
95,424 KB
testcase_13 AC 637 ms
253,372 KB
testcase_14 AC 636 ms
253,160 KB
testcase_15 AC 658 ms
252,976 KB
testcase_16 AC 639 ms
253,112 KB
testcase_17 AC 646 ms
253,000 KB
testcase_18 AC 62 ms
66,940 KB
testcase_19 AC 63 ms
68,164 KB
testcase_20 AC 61 ms
66,504 KB
testcase_21 AC 61 ms
66,888 KB
testcase_22 AC 61 ms
67,336 KB
testcase_23 AC 62 ms
67,200 KB
testcase_24 AC 62 ms
67,100 KB
testcase_25 AC 62 ms
67,488 KB
testcase_26 AC 69 ms
72,648 KB
testcase_27 AC 71 ms
75,560 KB
testcase_28 AC 83 ms
86,944 KB
testcase_29 AC 98 ms
92,548 KB
testcase_30 AC 272 ms
167,052 KB
testcase_31 AC 360 ms
185,496 KB
testcase_32 AC 472 ms
174,252 KB
testcase_33 AC 237 ms
114,712 KB
testcase_34 AC 401 ms
182,100 KB
testcase_35 AC 376 ms
169,408 KB
testcase_36 AC 397 ms
180,376 KB
testcase_37 AC 369 ms
166,716 KB
testcase_38 AC 430 ms
195,120 KB
testcase_39 AC 316 ms
151,064 KB
testcase_40 AC 323 ms
150,988 KB
testcase_41 AC 327 ms
151,352 KB
testcase_42 AC 62 ms
67,188 KB
testcase_43 AC 63 ms
67,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

class osa_k:
    min_factor = []
    def __init__(self, n):
        self.min_factor = list(range(n + 1))
        i = 2
        while i * i <= n:
            if self.min_factor[i] < i:
                i += 1
                continue
            for j in range(i*i, n + 1, i):
                if self.min_factor[j] == j:
                    self.min_factor[j] = i
            i += 1

    def factor(self, n):
        res = []
        while n > 1:
            res.append(self.min_factor[n])
            n //= self.min_factor[n]
        return len(res)

    def divisors(self, n):
        res = [1]
        while n > 1:
            x = self.min_factor[n]
            cnt = 0
            while n % x == 0:
                cnt += 1
                n //= x
            t = []
            p = 1
            for i in range(cnt + 1):
                for j in range(len(res)):
                    t.append(res[j] * p)
                p *= x
            res = t[:]
        return res


n = int(input())
a = list(map(int, input().split()))
os = osa_k(1000000)
g = 0
for x in a:
    g ^= os.factor(x)
if g == 0:
    print('black')
else:
    print('white')
0