結果

問題 No.1665 quotient replace
ユーザー shiroha_F14shiroha_F14
提出日時 2021-08-11 20:40:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,628 ms / 3,000 ms
コード長 481 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 142,204 KB
最終ジャッジ日時 2023-08-21 18:57:45
合計ジャッジ時間 68,737 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,037 ms
18,720 KB
testcase_01 AC 1,035 ms
18,740 KB
testcase_02 AC 1,026 ms
18,716 KB
testcase_03 AC 1,014 ms
19,200 KB
testcase_04 AC 1,083 ms
19,240 KB
testcase_05 AC 1,075 ms
18,780 KB
testcase_06 AC 1,039 ms
19,816 KB
testcase_07 AC 1,060 ms
19,308 KB
testcase_08 AC 1,029 ms
19,528 KB
testcase_09 AC 1,146 ms
22,320 KB
testcase_10 AC 1,628 ms
58,164 KB
testcase_11 AC 2,139 ms
107,712 KB
testcase_12 AC 1,180 ms
28,416 KB
testcase_13 AC 2,559 ms
142,108 KB
testcase_14 AC 2,567 ms
142,100 KB
testcase_15 AC 2,566 ms
142,204 KB
testcase_16 AC 2,628 ms
142,076 KB
testcase_17 AC 2,584 ms
142,012 KB
testcase_18 AC 1,066 ms
18,744 KB
testcase_19 AC 1,100 ms
18,856 KB
testcase_20 AC 1,026 ms
18,848 KB
testcase_21 AC 1,017 ms
18,744 KB
testcase_22 AC 1,028 ms
18,800 KB
testcase_23 AC 1,056 ms
18,708 KB
testcase_24 AC 1,062 ms
18,736 KB
testcase_25 AC 1,046 ms
18,872 KB
testcase_26 AC 1,081 ms
19,156 KB
testcase_27 AC 1,037 ms
19,816 KB
testcase_28 AC 1,054 ms
22,860 KB
testcase_29 AC 1,087 ms
26,568 KB
testcase_30 AC 1,490 ms
78,144 KB
testcase_31 AC 1,658 ms
110,380 KB
testcase_32 AC 2,152 ms
103,352 KB
testcase_33 AC 1,463 ms
50,500 KB
testcase_34 AC 1,935 ms
86,952 KB
testcase_35 AC 1,843 ms
80,960 KB
testcase_36 AC 1,908 ms
83,868 KB
testcase_37 AC 1,774 ms
78,156 KB
testcase_38 AC 1,919 ms
86,160 KB
testcase_39 AC 1,705 ms
68,756 KB
testcase_40 AC 1,740 ms
68,820 KB
testcase_41 AC 1,673 ms
68,756 KB
testcase_42 AC 1,030 ms
18,768 KB
testcase_43 AC 1,047 ms
18,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# Python (not PyPy) speed test

spf = [0 for i in range(1000001)]
pr = []
for i in range(2, 1000001):
    if spf[i] == 0:
        spf[i] = i
        pr.append(i)
    j = 0
    while j < len(pr) and pr[j] <= spf[i] and i * pr[j] <= 1000000:
        spf[i * pr[j]] = pr[j]
        j += 1

n = int(input())
a = list(map(int, input().split()))
fold = 0
for v in a:
    cnt = 0
    while v > 1:
        v //= spf[v]
        cnt += 1
    fold ^= cnt

print("white" if fold else "black")
0