結果

問題 No.1665 quotient replace
ユーザー rlangevinrlangevin
提出日時 2023-02-17 08:54:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 418 ms / 3,000 ms
コード長 597 bytes
コンパイル時間 1,035 ms
コンパイル使用メモリ 86,808 KB
実行使用メモリ 270,592 KB
最終ジャッジ日時 2023-09-26 10:33:34
合計ジャッジ時間 16,399 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,340 KB
testcase_01 AC 72 ms
71,200 KB
testcase_02 AC 73 ms
71,440 KB
testcase_03 AC 185 ms
96,268 KB
testcase_04 AC 170 ms
96,688 KB
testcase_05 AC 137 ms
96,740 KB
testcase_06 AC 185 ms
96,948 KB
testcase_07 AC 148 ms
97,000 KB
testcase_08 AC 202 ms
96,768 KB
testcase_09 AC 148 ms
99,428 KB
testcase_10 AC 235 ms
141,960 KB
testcase_11 AC 352 ms
192,392 KB
testcase_12 AC 192 ms
109,200 KB
testcase_13 AC 418 ms
270,572 KB
testcase_14 AC 392 ms
270,592 KB
testcase_15 AC 408 ms
270,468 KB
testcase_16 AC 381 ms
270,300 KB
testcase_17 AC 351 ms
270,508 KB
testcase_18 AC 115 ms
87,368 KB
testcase_19 AC 106 ms
82,720 KB
testcase_20 AC 118 ms
88,308 KB
testcase_21 AC 125 ms
89,692 KB
testcase_22 AC 113 ms
84,184 KB
testcase_23 AC 136 ms
92,596 KB
testcase_24 AC 116 ms
87,340 KB
testcase_25 AC 106 ms
84,296 KB
testcase_26 AC 151 ms
96,980 KB
testcase_27 AC 151 ms
96,932 KB
testcase_28 AC 148 ms
100,280 KB
testcase_29 AC 158 ms
106,276 KB
testcase_30 AC 256 ms
182,384 KB
testcase_31 AC 305 ms
212,652 KB
testcase_32 AC 273 ms
183,228 KB
testcase_33 AC 208 ms
127,836 KB
testcase_34 AC 265 ms
198,560 KB
testcase_35 AC 255 ms
185,176 KB
testcase_36 AC 274 ms
195,952 KB
testcase_37 AC 257 ms
182,548 KB
testcase_38 AC 282 ms
206,692 KB
testcase_39 AC 227 ms
159,604 KB
testcase_40 AC 228 ms
159,556 KB
testcase_41 AC 234 ms
159,776 KB
testcase_42 AC 73 ms
71,104 KB
testcase_43 AC 75 ms
71,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt, ceil
def Sieve(n):
    lst = [True] * (n + 1)
    S = []
    for i in range(2, ceil(sqrt(n)) + 1):
        if lst[i]:
            for j in range(2 * i, n + 1, i):
                lst[j] = False
    for i in range(2, n + 1):
        if lst[i]:
            S.append(i)
    return S

N = int(input())
A = list(map(int, input().split()))
M = max(A)
D = [0] * (M + 1)

for p in Sieve(M):
    now = p
    while now <= M:
        for i in range(now, M + 1, now):
            D[i] += 1
        now *= p

ans = 0
for a in A:
    ans ^= D[a]

print("white") if ans else print("black")
0