結果

問題 No.1665 quotient replace
ユーザー AEnAEn
提出日時 2022-09-07 00:45:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,161 ms / 3,000 ms
コード長 522 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 82,024 KB
実行使用メモリ 253,752 KB
最終ジャッジ日時 2024-05-01 18:57:53
合計ジャッジ時間 33,486 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
59,776 KB
testcase_01 AC 45 ms
60,160 KB
testcase_02 AC 44 ms
59,904 KB
testcase_03 AC 52 ms
67,328 KB
testcase_04 AC 55 ms
67,584 KB
testcase_05 AC 49 ms
66,048 KB
testcase_06 AC 91 ms
78,720 KB
testcase_07 AC 66 ms
71,552 KB
testcase_08 AC 75 ms
75,520 KB
testcase_09 AC 166 ms
86,272 KB
testcase_10 AC 979 ms
129,452 KB
testcase_11 AC 1,761 ms
175,188 KB
testcase_12 AC 319 ms
95,488 KB
testcase_13 AC 2,161 ms
253,192 KB
testcase_14 AC 2,143 ms
253,100 KB
testcase_15 AC 2,139 ms
253,364 KB
testcase_16 AC 2,150 ms
253,752 KB
testcase_17 AC 2,112 ms
253,344 KB
testcase_18 AC 47 ms
60,160 KB
testcase_19 AC 44 ms
60,160 KB
testcase_20 AC 46 ms
59,776 KB
testcase_21 AC 44 ms
60,160 KB
testcase_22 AC 45 ms
59,904 KB
testcase_23 AC 45 ms
59,392 KB
testcase_24 AC 44 ms
60,288 KB
testcase_25 AC 47 ms
59,520 KB
testcase_26 AC 76 ms
70,016 KB
testcase_27 AC 120 ms
73,856 KB
testcase_28 AC 323 ms
87,356 KB
testcase_29 AC 505 ms
92,540 KB
testcase_30 AC 944 ms
165,588 KB
testcase_31 AC 984 ms
185,000 KB
testcase_32 AC 1,711 ms
174,708 KB
testcase_33 AC 824 ms
114,752 KB
testcase_34 AC 1,487 ms
182,208 KB
testcase_35 AC 1,391 ms
167,908 KB
testcase_36 AC 1,435 ms
179,492 KB
testcase_37 AC 1,337 ms
165,668 KB
testcase_38 AC 1,527 ms
194,600 KB
testcase_39 AC 1,167 ms
150,988 KB
testcase_40 AC 1,181 ms
150,700 KB
testcase_41 AC 1,177 ms
151,244 KB
testcase_42 AC 43 ms
60,160 KB
testcase_43 AC 43 ms
59,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

def fac(M):
    if M == 1:
        return 0
    else:
        cnt = 0
        s = 2
        while s*s<=M:
            if M%s==0:
                while M%s==0:
                    M//=s
                    cnt += 1
            s += 1
        if M>1:
            cnt += 1
        return cnt

cal = [-1]*(10**6+1)
res = 0
for i in range(N):
    if cal[A[i]] == -1:
        cal[A[i]] = fac(A[i])
    res ^= cal[A[i]]
if res==0:
    print('black')
else:
    print('white')
0