結果

問題 No.1665 quotient replace
ユーザー tktk_snsntktk_snsn
提出日時 2021-09-03 22:03:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,137 ms / 3,000 ms
コード長 604 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 129,332 KB
最終ジャッジ日時 2024-05-09 04:04:24
合計ジャッジ時間 39,944 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 332 ms
21,504 KB
testcase_01 AC 331 ms
21,504 KB
testcase_02 AC 334 ms
21,504 KB
testcase_03 AC 333 ms
21,632 KB
testcase_04 AC 338 ms
21,504 KB
testcase_05 AC 336 ms
21,632 KB
testcase_06 AC 345 ms
21,828 KB
testcase_07 AC 340 ms
21,504 KB
testcase_08 AC 340 ms
21,504 KB
testcase_09 AC 386 ms
24,004 KB
testcase_10 AC 937 ms
57,440 KB
testcase_11 AC 1,699 ms
97,504 KB
testcase_12 AC 475 ms
29,772 KB
testcase_13 AC 2,060 ms
129,204 KB
testcase_14 AC 2,071 ms
129,332 KB
testcase_15 AC 2,072 ms
129,204 KB
testcase_16 AC 2,137 ms
129,204 KB
testcase_17 AC 2,007 ms
129,204 KB
testcase_18 AC 333 ms
21,504 KB
testcase_19 AC 332 ms
21,504 KB
testcase_20 AC 334 ms
21,632 KB
testcase_21 AC 328 ms
21,504 KB
testcase_22 AC 332 ms
21,760 KB
testcase_23 AC 338 ms
21,632 KB
testcase_24 AC 334 ms
21,504 KB
testcase_25 AC 332 ms
21,504 KB
testcase_26 AC 335 ms
21,504 KB
testcase_27 AC 341 ms
21,700 KB
testcase_28 AC 366 ms
24,516 KB
testcase_29 AC 400 ms
27,712 KB
testcase_30 AC 838 ms
71,068 KB
testcase_31 AC 1,125 ms
99,608 KB
testcase_32 AC 1,587 ms
94,060 KB
testcase_33 AC 826 ms
48,372 KB
testcase_34 AC 1,346 ms
79,764 KB
testcase_35 AC 1,259 ms
74,580 KB
testcase_36 AC 1,292 ms
77,220 KB
testcase_37 AC 1,231 ms
75,436 KB
testcase_38 AC 1,403 ms
85,372 KB
testcase_39 AC 1,069 ms
64,304 KB
testcase_40 AC 1,048 ms
64,312 KB
testcase_41 AC 1,106 ms
64,312 KB
testcase_42 AC 330 ms
21,504 KB
testcase_43 AC 330 ms
21,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

U = 10 ** 6


def prime_sieve(N):
    #sieve[i] : iの最小の素因数
    sieve = [0] * (N + 1)
    prime = []
    for i in range(2, N + 1):
        if sieve[i] == 0:
            sieve[i] = i
            prime.append(i)
        for p in prime:
            if p > sieve[i] or i * p > N:
                break
            sieve[i * p] = p
    return sieve


sieve = prime_sieve(U + 5)
N = int(input())
A = list(map(int, input().split()))

xor = 0
for a in A:
    cnt = 0
    while sieve[a] != 0:
        cnt += 1
        a //= sieve[a]
    xor ^= cnt

if xor:
    print("white")
else:
    print("black")
0