結果

問題 No.1665 quotient replace
ユーザー 👑 rin204rin204
提出日時 2021-09-03 21:40:47
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,866 ms / 3,000 ms
コード長 641 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 251,364 KB
最終ジャッジ日時 2023-08-21 20:37:16
合計ジャッジ時間 21,725 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
76,104 KB
testcase_01 AC 76 ms
76,244 KB
testcase_02 AC 76 ms
76,500 KB
testcase_03 AC 86 ms
76,644 KB
testcase_04 AC 85 ms
76,460 KB
testcase_05 AC 81 ms
76,480 KB
testcase_06 AC 95 ms
76,916 KB
testcase_07 AC 88 ms
76,892 KB
testcase_08 AC 93 ms
76,908 KB
testcase_09 AC 118 ms
79,708 KB
testcase_10 AC 440 ms
122,208 KB
testcase_11 AC 862 ms
172,648 KB
testcase_12 AC 176 ms
89,452 KB
testcase_13 AC 1,101 ms
250,524 KB
testcase_14 AC 1,108 ms
250,924 KB
testcase_15 AC 1,107 ms
251,364 KB
testcase_16 AC 1,145 ms
250,732 KB
testcase_17 AC 1,111 ms
251,056 KB
testcase_18 AC 77 ms
76,400 KB
testcase_19 AC 79 ms
76,104 KB
testcase_20 AC 78 ms
76,508 KB
testcase_21 AC 77 ms
76,272 KB
testcase_22 AC 77 ms
76,100 KB
testcase_23 AC 78 ms
76,292 KB
testcase_24 AC 77 ms
76,032 KB
testcase_25 AC 78 ms
76,340 KB
testcase_26 AC 88 ms
76,988 KB
testcase_27 AC 97 ms
76,772 KB
testcase_28 AC 156 ms
80,236 KB
testcase_29 AC 238 ms
85,948 KB
testcase_30 AC 1,239 ms
150,392 KB
testcase_31 AC 1,866 ms
192,616 KB
testcase_32 AC 820 ms
167,404 KB
testcase_33 AC 376 ms
108,048 KB
testcase_34 AC 689 ms
178,684 KB
testcase_35 AC 637 ms
165,504 KB
testcase_36 AC 666 ms
176,568 KB
testcase_37 AC 616 ms
162,752 KB
testcase_38 AC 723 ms
191,772 KB
testcase_39 AC 537 ms
139,648 KB
testcase_40 AC 533 ms
139,524 KB
testcase_41 AC 532 ms
139,700 KB
testcase_42 AC 78 ms
76,244 KB
testcase_43 AC 78 ms
76,248 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