結果

問題 No.1665 quotient replace
ユーザー tktk_snsntktk_snsn
提出日時 2021-09-03 22:03:02
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 1,958 ms / 3,000 ms
コード長 604 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 10,832 KB
実行使用メモリ 141,568 KB
最終ジャッジ日時 2023-08-21 21:54:32
合計ジャッジ時間 33,622 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 251 ms
18,892 KB
testcase_01 AC 254 ms
18,912 KB
testcase_02 AC 253 ms
18,856 KB
testcase_03 AC 256 ms
18,896 KB
testcase_04 AC 251 ms
18,892 KB
testcase_05 AC 250 ms
19,040 KB
testcase_06 AC 260 ms
19,300 KB
testcase_07 AC 249 ms
18,880 KB
testcase_08 AC 254 ms
19,016 KB
testcase_09 AC 298 ms
21,568 KB
testcase_10 AC 815 ms
57,388 KB
testcase_11 AC 1,507 ms
108,120 KB
testcase_12 AC 382 ms
28,592 KB
testcase_13 AC 1,909 ms
141,484 KB
testcase_14 AC 1,873 ms
141,568 KB
testcase_15 AC 1,929 ms
141,384 KB
testcase_16 AC 1,853 ms
141,536 KB
testcase_17 AC 1,958 ms
141,380 KB
testcase_18 AC 249 ms
18,808 KB
testcase_19 AC 252 ms
18,884 KB
testcase_20 AC 251 ms
19,028 KB
testcase_21 AC 247 ms
18,972 KB
testcase_22 AC 246 ms
19,044 KB
testcase_23 AC 252 ms
18,944 KB
testcase_24 AC 246 ms
18,876 KB
testcase_25 AC 254 ms
18,900 KB
testcase_26 AC 251 ms
18,860 KB
testcase_27 AC 255 ms
19,008 KB
testcase_28 AC 278 ms
22,096 KB
testcase_29 AC 308 ms
26,152 KB
testcase_30 AC 685 ms
77,188 KB
testcase_31 AC 948 ms
109,736 KB
testcase_32 AC 1,470 ms
102,660 KB
testcase_33 AC 688 ms
48,180 KB
testcase_34 AC 1,200 ms
86,252 KB
testcase_35 AC 1,144 ms
84,240 KB
testcase_36 AC 1,180 ms
83,384 KB
testcase_37 AC 1,107 ms
77,380 KB
testcase_38 AC 1,251 ms
85,748 KB
testcase_39 AC 1,016 ms
68,464 KB
testcase_40 AC 940 ms
68,588 KB
testcase_41 AC 944 ms
68,640 KB
testcase_42 AC 248 ms
18,856 KB
testcase_43 AC 251 ms
18,864 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