結果

問題 No.1665 quotient replace
ユーザー tamatotamato
提出日時 2021-09-03 21:39:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 681 ms / 3,000 ms
コード長 808 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 224,368 KB
最終ジャッジ日時 2024-05-09 02:32:02
合計ジャッジ時間 26,834 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 494 ms
92,032 KB
testcase_01 AC 491 ms
91,964 KB
testcase_02 AC 496 ms
92,008 KB
testcase_03 AC 494 ms
92,416 KB
testcase_04 AC 490 ms
91,964 KB
testcase_05 AC 494 ms
91,796 KB
testcase_06 AC 491 ms
92,100 KB
testcase_07 AC 496 ms
92,168 KB
testcase_08 AC 494 ms
91,888 KB
testcase_09 AC 506 ms
94,432 KB
testcase_10 AC 559 ms
147,180 KB
testcase_11 AC 626 ms
191,304 KB
testcase_12 AC 515 ms
100,956 KB
testcase_13 AC 672 ms
224,300 KB
testcase_14 AC 681 ms
224,368 KB
testcase_15 AC 669 ms
224,128 KB
testcase_16 AC 668 ms
224,136 KB
testcase_17 AC 672 ms
224,200 KB
testcase_18 AC 491 ms
92,024 KB
testcase_19 AC 491 ms
92,032 KB
testcase_20 AC 497 ms
91,904 KB
testcase_21 AC 493 ms
91,904 KB
testcase_22 AC 494 ms
92,056 KB
testcase_23 AC 498 ms
91,968 KB
testcase_24 AC 492 ms
92,104 KB
testcase_25 AC 494 ms
92,020 KB
testcase_26 AC 497 ms
92,160 KB
testcase_27 AC 494 ms
92,128 KB
testcase_28 AC 498 ms
95,012 KB
testcase_29 AC 504 ms
100,436 KB
testcase_30 AC 588 ms
171,828 KB
testcase_31 AC 644 ms
206,528 KB
testcase_32 AC 628 ms
191,524 KB
testcase_33 AC 556 ms
134,036 KB
testcase_34 AC 618 ms
164,244 KB
testcase_35 AC 606 ms
155,848 KB
testcase_36 AC 616 ms
164,292 KB
testcase_37 AC 587 ms
171,556 KB
testcase_38 AC 616 ms
174,064 KB
testcase_39 AC 573 ms
162,044 KB
testcase_40 AC 568 ms
162,184 KB
testcase_41 AC 573 ms
162,304 KB
testcase_42 AC 501 ms
91,904 KB
testcase_43 AC 502 ms
91,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    M = 10 ** 6
    min_factor = list(range(M+1))
    for i in range(2, M+1):
        for x in range(1, M+1):
            if i * x > M:
                break
            if min_factor[i*x] == i*x:
                min_factor[i*x] = i

    G = [0] * (M+1)
    for i in range(2, M+1):
        P = {}
        ii = i
        while ii != 1:
            p = min_factor[ii]
            if p not in P:
                P[p] = 0
            P[p] += 1
            ii //= p
        for p in P:
            G[i] += P[p]
    N = int(input())
    A = list(map(int, input().split()))
    g = 0
    for a in A:
        g ^= G[a]
    if g:
        print("white")
    else:
        print("black")


if __name__ == '__main__':
    main()
0