結果

問題 No.1665 quotient replace
ユーザー asumo0729asumo0729
提出日時 2021-09-03 23:13:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 354 ms / 3,000 ms
コード長 969 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 87,416 KB
実行使用メモリ 260,372 KB
最終ジャッジ日時 2023-08-22 00:55:19
合計ジャッジ時間 12,573 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
96,948 KB
testcase_01 AC 143 ms
97,048 KB
testcase_02 AC 145 ms
97,124 KB
testcase_03 AC 147 ms
97,008 KB
testcase_04 AC 144 ms
97,004 KB
testcase_05 AC 144 ms
97,020 KB
testcase_06 AC 148 ms
97,352 KB
testcase_07 AC 150 ms
97,348 KB
testcase_08 AC 146 ms
97,564 KB
testcase_09 AC 152 ms
99,848 KB
testcase_10 AC 212 ms
146,492 KB
testcase_11 AC 289 ms
194,336 KB
testcase_12 AC 165 ms
109,332 KB
testcase_13 AC 354 ms
259,884 KB
testcase_14 AC 351 ms
260,168 KB
testcase_15 AC 351 ms
260,372 KB
testcase_16 AC 352 ms
259,976 KB
testcase_17 AC 350 ms
260,076 KB
testcase_18 AC 142 ms
96,964 KB
testcase_19 AC 141 ms
97,096 KB
testcase_20 AC 142 ms
96,980 KB
testcase_21 AC 142 ms
97,044 KB
testcase_22 AC 142 ms
97,272 KB
testcase_23 AC 148 ms
97,168 KB
testcase_24 AC 142 ms
97,040 KB
testcase_25 AC 142 ms
97,072 KB
testcase_26 AC 145 ms
97,528 KB
testcase_27 AC 148 ms
97,424 KB
testcase_28 AC 153 ms
100,592 KB
testcase_29 AC 159 ms
105,924 KB
testcase_30 AC 239 ms
174,112 KB
testcase_31 AC 297 ms
207,168 KB
testcase_32 AC 287 ms
190,164 KB
testcase_33 AC 200 ms
133,652 KB
testcase_34 AC 272 ms
197,604 KB
testcase_35 AC 261 ms
191,144 KB
testcase_36 AC 263 ms
200,900 KB
testcase_37 AC 238 ms
174,396 KB
testcase_38 AC 269 ms
176,984 KB
testcase_39 AC 227 ms
162,904 KB
testcase_40 AC 227 ms
162,800 KB
testcase_41 AC 228 ms
162,848 KB
testcase_42 AC 144 ms
96,864 KB
testcase_43 AC 142 ms
97,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
stdin=sys.stdin
sys.setrecursionlimit(10 ** 8)

ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
Yp=lambda:print('Yes')
Np=lambda:print('No')
inf = 1 << 60
eps = 1e-9
sortkey = itemgetter(0)

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

N = ip()
A = lp()

B = [0 for _ in range(10 ** 6 + 1)]
prime = primes(10 ** 6)
for get in prime:
    now = get
    while now < 10 ** 6:
        temp = now
        while temp <= 10 ** 6:
            B[temp] += 1
            temp += now
        now *= get

x = 0
for get in A:
  x ^= B[get]

if not x:
    print("black")
else:
    print("white")
0