結果

問題 No.1665 quotient replace
ユーザー asumo0729asumo0729
提出日時 2021-09-03 23:13:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 284 ms / 3,000 ms
コード長 969 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 243,656 KB
最終ジャッジ日時 2024-05-09 06:55:26
合計ジャッジ時間 9,259 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
83,072 KB
testcase_01 AC 98 ms
83,072 KB
testcase_02 AC 99 ms
83,200 KB
testcase_03 AC 98 ms
83,328 KB
testcase_04 AC 100 ms
83,200 KB
testcase_05 AC 102 ms
83,200 KB
testcase_06 AC 107 ms
86,272 KB
testcase_07 AC 100 ms
84,864 KB
testcase_08 AC 102 ms
85,504 KB
testcase_09 AC 108 ms
90,752 KB
testcase_10 AC 175 ms
140,068 KB
testcase_11 AC 235 ms
182,584 KB
testcase_12 AC 122 ms
103,168 KB
testcase_13 AC 279 ms
243,656 KB
testcase_14 AC 284 ms
243,632 KB
testcase_15 AC 283 ms
243,248 KB
testcase_16 AC 283 ms
243,252 KB
testcase_17 AC 283 ms
243,484 KB
testcase_18 AC 107 ms
83,328 KB
testcase_19 AC 102 ms
83,200 KB
testcase_20 AC 102 ms
83,328 KB
testcase_21 AC 99 ms
83,200 KB
testcase_22 AC 100 ms
83,176 KB
testcase_23 AC 100 ms
83,712 KB
testcase_24 AC 102 ms
83,328 KB
testcase_25 AC 101 ms
83,328 KB
testcase_26 AC 105 ms
84,992 KB
testcase_27 AC 109 ms
86,272 KB
testcase_28 AC 112 ms
91,520 KB
testcase_29 AC 121 ms
99,328 KB
testcase_30 AC 195 ms
168,756 KB
testcase_31 AC 262 ms
200,492 KB
testcase_32 AC 231 ms
182,536 KB
testcase_33 AC 167 ms
126,952 KB
testcase_34 AC 205 ms
180,484 KB
testcase_35 AC 198 ms
169,648 KB
testcase_36 AC 201 ms
179,984 KB
testcase_37 AC 195 ms
168,348 KB
testcase_38 AC 235 ms
208,556 KB
testcase_39 AC 189 ms
158,432 KB
testcase_40 AC 189 ms
158,292 KB
testcase_41 AC 188 ms
158,292 KB
testcase_42 AC 101 ms
83,456 KB
testcase_43 AC 101 ms
83,328 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