結果

問題 No.1665 quotient replace
ユーザー titiatitia
提出日時 2021-09-03 21:47:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,714 ms / 3,000 ms
コード長 673 bytes
コンパイル時間 562 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 259,716 KB
最終ジャッジ日時 2023-08-21 21:07:28
合計ジャッジ時間 115,650 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,408 ms
93,536 KB
testcase_01 AC 2,389 ms
93,140 KB
testcase_02 AC 2,404 ms
93,412 KB
testcase_03 AC 2,403 ms
93,312 KB
testcase_04 AC 2,440 ms
93,244 KB
testcase_05 AC 2,399 ms
93,484 KB
testcase_06 AC 2,396 ms
93,756 KB
testcase_07 AC 2,412 ms
93,420 KB
testcase_08 AC 2,446 ms
93,620 KB
testcase_09 AC 2,406 ms
96,172 KB
testcase_10 AC 2,473 ms
141,452 KB
testcase_11 AC 2,596 ms
186,804 KB
testcase_12 AC 2,410 ms
103,728 KB
testcase_13 AC 2,676 ms
259,136 KB
testcase_14 AC 2,714 ms
259,716 KB
testcase_15 AC 2,612 ms
259,232 KB
testcase_16 AC 2,604 ms
258,920 KB
testcase_17 AC 2,620 ms
258,968 KB
testcase_18 AC 2,404 ms
93,284 KB
testcase_19 AC 2,421 ms
93,516 KB
testcase_20 AC 2,415 ms
93,396 KB
testcase_21 AC 2,398 ms
93,384 KB
testcase_22 AC 2,420 ms
93,368 KB
testcase_23 AC 2,417 ms
93,256 KB
testcase_24 AC 2,405 ms
93,368 KB
testcase_25 AC 2,407 ms
93,264 KB
testcase_26 AC 2,411 ms
93,976 KB
testcase_27 AC 2,411 ms
93,684 KB
testcase_28 AC 2,424 ms
96,360 KB
testcase_29 AC 2,437 ms
100,656 KB
testcase_30 AC 2,539 ms
177,956 KB
testcase_31 AC 2,598 ms
205,040 KB
testcase_32 AC 2,546 ms
181,732 KB
testcase_33 AC 2,515 ms
124,556 KB
testcase_34 AC 2,547 ms
193,548 KB
testcase_35 AC 2,541 ms
180,284 KB
testcase_36 AC 2,528 ms
192,164 KB
testcase_37 AC 2,523 ms
178,060 KB
testcase_38 AC 2,559 ms
206,400 KB
testcase_39 AC 2,502 ms
163,044 KB
testcase_40 AC 2,518 ms
162,944 KB
testcase_41 AC 2,498 ms
162,984 KB
testcase_42 AC 2,400 ms
93,492 KB
testcase_43 AC 2,434 ms
93,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

Grundy=[-1]*(10**6+1)
Grundy[1]=0
A=[i for i in range(10**6+1)]

for i in range(2,10**6+1):
    if A[i]==i:
        for j in range(i,10**6+1,i):
            A[j]=i

def fac(x):
    L={1}
    while x!=1:
        L|={l*A[x] for l in L}
        x//=A[x]
    return L
        

for i in range(2,10**6+1):
    S=set()
    for f in fac(i):
        S.add(Grundy[f])

    for k in range(1000):
        if k in S:
            continue
        else:
            Grundy[i]=k
            break

XOR=0
for ax in AX:
    XOR^=Grundy[ax]

if XOR!=0:
    print("white")
else:
    print("black")
    
0