結果

問題 No.1665 quotient replace
ユーザー hir355hir355
提出日時 2021-09-03 21:31:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 758 ms / 3,000 ms
コード長 1,141 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 258,704 KB
最終ジャッジ日時 2023-08-21 19:57:36
合計ジャッジ時間 15,074 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
83,404 KB
testcase_01 AC 94 ms
83,400 KB
testcase_02 AC 94 ms
83,404 KB
testcase_03 AC 95 ms
84,088 KB
testcase_04 AC 99 ms
83,852 KB
testcase_05 AC 96 ms
83,232 KB
testcase_06 AC 108 ms
84,476 KB
testcase_07 AC 103 ms
84,364 KB
testcase_08 AC 104 ms
84,536 KB
testcase_09 AC 120 ms
87,476 KB
testcase_10 AC 298 ms
134,608 KB
testcase_11 AC 516 ms
187,972 KB
testcase_12 AC 177 ms
96,636 KB
testcase_13 AC 733 ms
258,704 KB
testcase_14 AC 758 ms
258,476 KB
testcase_15 AC 655 ms
258,296 KB
testcase_16 AC 669 ms
257,768 KB
testcase_17 AC 671 ms
258,148 KB
testcase_18 AC 98 ms
83,396 KB
testcase_19 AC 97 ms
83,320 KB
testcase_20 AC 94 ms
83,184 KB
testcase_21 AC 96 ms
83,288 KB
testcase_22 AC 98 ms
83,336 KB
testcase_23 AC 96 ms
83,344 KB
testcase_24 AC 96 ms
83,404 KB
testcase_25 AC 94 ms
83,344 KB
testcase_26 AC 100 ms
84,440 KB
testcase_27 AC 103 ms
84,476 KB
testcase_28 AC 113 ms
88,204 KB
testcase_29 AC 124 ms
93,608 KB
testcase_30 AC 299 ms
170,060 KB
testcase_31 AC 391 ms
202,452 KB
testcase_32 AC 513 ms
181,032 KB
testcase_33 AC 278 ms
115,660 KB
testcase_34 AC 454 ms
186,420 KB
testcase_35 AC 420 ms
173,096 KB
testcase_36 AC 444 ms
184,560 KB
testcase_37 AC 393 ms
171,028 KB
testcase_38 AC 452 ms
198,972 KB
testcase_39 AC 357 ms
154,868 KB
testcase_40 AC 359 ms
154,916 KB
testcase_41 AC 357 ms
154,712 KB
testcase_42 AC 99 ms
83,292 KB
testcase_43 AC 96 ms
83,488 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