結果

問題 No.1665 quotient replace
ユーザー asumo0729asumo0729
提出日時 2021-09-14 16:57:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 475 ms / 3,000 ms
コード長 748 bytes
コンパイル時間 879 ms
コンパイル使用メモリ 86,680 KB
実行使用メモリ 222,384 KB
最終ジャッジ日時 2023-09-09 14:32:49
合計ジャッジ時間 14,201 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
84,844 KB
testcase_01 AC 131 ms
85,188 KB
testcase_02 AC 128 ms
85,256 KB
testcase_03 AC 138 ms
85,248 KB
testcase_04 AC 132 ms
85,400 KB
testcase_05 AC 130 ms
85,104 KB
testcase_06 AC 134 ms
85,252 KB
testcase_07 AC 135 ms
85,716 KB
testcase_08 AC 135 ms
85,608 KB
testcase_09 AC 142 ms
87,904 KB
testcase_10 AC 268 ms
139,192 KB
testcase_11 AC 426 ms
208,992 KB
testcase_12 AC 166 ms
96,976 KB
testcase_13 AC 475 ms
218,300 KB
testcase_14 AC 463 ms
218,692 KB
testcase_15 AC 446 ms
218,856 KB
testcase_16 AC 470 ms
218,440 KB
testcase_17 AC 455 ms
218,636 KB
testcase_18 AC 129 ms
85,248 KB
testcase_19 AC 129 ms
85,000 KB
testcase_20 AC 128 ms
85,196 KB
testcase_21 AC 130 ms
84,888 KB
testcase_22 AC 130 ms
84,932 KB
testcase_23 AC 128 ms
85,140 KB
testcase_24 AC 129 ms
85,036 KB
testcase_25 AC 130 ms
85,224 KB
testcase_26 AC 132 ms
85,376 KB
testcase_27 AC 133 ms
85,360 KB
testcase_28 AC 141 ms
88,640 KB
testcase_29 AC 148 ms
94,236 KB
testcase_30 AC 244 ms
151,132 KB
testcase_31 AC 312 ms
222,384 KB
testcase_32 AC 381 ms
205,776 KB
testcase_33 AC 226 ms
127,968 KB
testcase_34 AC 329 ms
161,772 KB
testcase_35 AC 304 ms
150,868 KB
testcase_36 AC 322 ms
161,956 KB
testcase_37 AC 306 ms
151,112 KB
testcase_38 AC 337 ms
173,956 KB
testcase_39 AC 281 ms
140,644 KB
testcase_40 AC 282 ms
140,688 KB
testcase_41 AC 280 ms
140,788 KB
testcase_42 AC 130 ms
85,352 KB
testcase_43 AC 129 ms
85,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
from collections import defaultdict, deque
import heapq
import bisect
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)

Max = 10 ** 6 + 10
N = ip()
A = lp()

spf = [0 for _ in range(Max)]

for i in range(2, Max):
    if spf[i] != 0:
        continue
    for j in range(i, Max, i):
        spf[j] = i

Xor = 0
for get in A:
    res = 0
    while get != 1:
        now = spf[get]
        res += 1
        get //= now
    Xor ^= res

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