結果

問題 No.1665 quotient replace
ユーザー 👑 rin204rin204
提出日時 2021-09-03 21:40:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,812 ms / 3,000 ms
コード長 641 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 82,784 KB
実行使用メモリ 246,048 KB
最終ジャッジ日時 2024-05-09 02:38:37
合計ジャッジ時間 19,604 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
59,520 KB
testcase_01 AC 45 ms
59,008 KB
testcase_02 AC 45 ms
59,520 KB
testcase_03 AC 55 ms
64,512 KB
testcase_04 AC 53 ms
63,488 KB
testcase_05 AC 48 ms
61,056 KB
testcase_06 AC 63 ms
66,688 KB
testcase_07 AC 57 ms
64,896 KB
testcase_08 AC 59 ms
65,408 KB
testcase_09 AC 88 ms
71,680 KB
testcase_10 AC 416 ms
120,176 KB
testcase_11 AC 828 ms
167,636 KB
testcase_12 AC 142 ms
84,352 KB
testcase_13 AC 1,110 ms
245,848 KB
testcase_14 AC 1,106 ms
245,656 KB
testcase_15 AC 1,109 ms
246,048 KB
testcase_16 AC 1,107 ms
245,532 KB
testcase_17 AC 1,098 ms
246,044 KB
testcase_18 AC 45 ms
59,904 KB
testcase_19 AC 44 ms
59,136 KB
testcase_20 AC 45 ms
59,264 KB
testcase_21 AC 44 ms
59,392 KB
testcase_22 AC 44 ms
59,520 KB
testcase_23 AC 44 ms
59,904 KB
testcase_24 AC 44 ms
59,392 KB
testcase_25 AC 45 ms
59,392 KB
testcase_26 AC 53 ms
61,824 KB
testcase_27 AC 64 ms
63,232 KB
testcase_28 AC 123 ms
68,736 KB
testcase_29 AC 203 ms
76,544 KB
testcase_30 AC 1,199 ms
147,172 KB
testcase_31 AC 1,812 ms
177,176 KB
testcase_32 AC 799 ms
166,724 KB
testcase_33 AC 348 ms
108,288 KB
testcase_34 AC 661 ms
174,784 KB
testcase_35 AC 595 ms
148,516 KB
testcase_36 AC 622 ms
158,268 KB
testcase_37 AC 564 ms
147,664 KB
testcase_38 AC 701 ms
187,376 KB
testcase_39 AC 503 ms
136,880 KB
testcase_40 AC 507 ms
136,756 KB
testcase_41 AC 506 ms
136,944 KB
testcase_42 AC 45 ms
59,220 KB
testcase_43 AC 44 ms
59,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
alst = list(map(int, input().split()))
x = 0

max_ = 10 ** 4
isprime = [True] * (max_ + 1)
isprime[0] = isprime[1] = False
for i in range(2, int(max_ ** 0.5 + 1)):
    if not isprime[i]:
        continue
    for j in range(i * i, max_ + 1, i):
        isprime[j] = False
primes = []
for i, tf in enumerate(isprime):
    if tf:
        primes.append(i)

for a in alst:
    cnt = 0
    p = 0
    while primes[p] ** 2 <= a:
        while a % primes[p] == 0:
            a //= primes[p]
            cnt += 1
        p += 1
    if a != 1:
        cnt += 1
    x ^= cnt
    
if x == 0:
    print("black")
else:
    print("white")
0