結果

問題 No.1665 quotient replace
ユーザー tassei903tassei903
提出日時 2021-09-03 22:29:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 597 ms / 3,000 ms
コード長 872 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 82,308 KB
実行使用メモリ 258,436 KB
最終ジャッジ日時 2024-05-09 05:11:17
合計ジャッジ時間 13,607 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
69,672 KB
testcase_01 AC 77 ms
69,188 KB
testcase_02 AC 79 ms
68,820 KB
testcase_03 AC 83 ms
71,204 KB
testcase_04 AC 86 ms
71,200 KB
testcase_05 AC 80 ms
69,376 KB
testcase_06 AC 87 ms
78,164 KB
testcase_07 AC 90 ms
72,500 KB
testcase_08 AC 88 ms
75,320 KB
testcase_09 AC 102 ms
86,648 KB
testcase_10 AC 263 ms
138,316 KB
testcase_11 AC 446 ms
191,276 KB
testcase_12 AC 147 ms
96,112 KB
testcase_13 AC 597 ms
258,352 KB
testcase_14 AC 586 ms
257,904 KB
testcase_15 AC 567 ms
258,436 KB
testcase_16 AC 585 ms
257,776 KB
testcase_17 AC 568 ms
257,872 KB
testcase_18 AC 79 ms
69,492 KB
testcase_19 AC 77 ms
70,284 KB
testcase_20 AC 93 ms
69,124 KB
testcase_21 AC 79 ms
70,216 KB
testcase_22 AC 78 ms
69,248 KB
testcase_23 AC 78 ms
69,944 KB
testcase_24 AC 78 ms
70,288 KB
testcase_25 AC 85 ms
69,764 KB
testcase_26 AC 87 ms
73,484 KB
testcase_27 AC 86 ms
76,108 KB
testcase_28 AC 103 ms
87,220 KB
testcase_29 AC 114 ms
92,992 KB
testcase_30 AC 269 ms
174,748 KB
testcase_31 AC 356 ms
204,996 KB
testcase_32 AC 444 ms
184,884 KB
testcase_33 AC 228 ms
121,888 KB
testcase_34 AC 354 ms
188,728 KB
testcase_35 AC 354 ms
177,312 KB
testcase_36 AC 398 ms
187,684 KB
testcase_37 AC 361 ms
175,208 KB
testcase_38 AC 397 ms
189,108 KB
testcase_39 AC 303 ms
160,428 KB
testcase_40 AC 339 ms
160,064 KB
testcase_41 AC 296 ms
160,140 KB
testcase_42 AC 78 ms
70,168 KB
testcase_43 AC 82 ms
70,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
sys.setrecursionlimit(10**7)
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
MAX = 10**6
arr = [-1] * (MAX + 1)
for i in range(2, int(MAX**0.5)+1):
    j = 1
    while i * j < len(arr):
        if arr[i * j] < 0:
            arr[i * j] = i
        j += 1
for i in range(1, len(arr)):
    if arr[i] == -1:
        arr[i] = i

def fastfactorization(n):
    res = 0
    while n>1:
        res+=1
        n//=arr[n]
    return res

n = ni()
a = na()

z = 0
for i in range(n):
    c = fastfactorization(a[i])
    z^=c

if z==0:
    print("black")
else:
    print("white")
0