結果

問題 No.1665 quotient replace
ユーザー 👑 tamatotamato
提出日時 2021-09-03 21:39:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 709 ms / 3,000 ms
コード長 808 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 222,676 KB
最終ジャッジ日時 2023-08-21 20:29:59
合計ジャッジ時間 28,544 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 529 ms
92,936 KB
testcase_01 AC 523 ms
92,928 KB
testcase_02 AC 526 ms
93,316 KB
testcase_03 AC 521 ms
93,064 KB
testcase_04 AC 525 ms
92,948 KB
testcase_05 AC 530 ms
93,084 KB
testcase_06 AC 534 ms
93,108 KB
testcase_07 AC 530 ms
93,404 KB
testcase_08 AC 533 ms
93,244 KB
testcase_09 AC 539 ms
95,580 KB
testcase_10 AC 593 ms
147,832 KB
testcase_11 AC 679 ms
195,012 KB
testcase_12 AC 547 ms
104,092 KB
testcase_13 AC 701 ms
222,228 KB
testcase_14 AC 702 ms
222,296 KB
testcase_15 AC 709 ms
222,412 KB
testcase_16 AC 707 ms
222,676 KB
testcase_17 AC 701 ms
222,336 KB
testcase_18 AC 531 ms
92,948 KB
testcase_19 AC 528 ms
92,944 KB
testcase_20 AC 526 ms
92,836 KB
testcase_21 AC 524 ms
93,288 KB
testcase_22 AC 526 ms
93,048 KB
testcase_23 AC 523 ms
92,840 KB
testcase_24 AC 519 ms
92,856 KB
testcase_25 AC 523 ms
92,912 KB
testcase_26 AC 526 ms
93,460 KB
testcase_27 AC 527 ms
93,004 KB
testcase_28 AC 535 ms
96,268 KB
testcase_29 AC 538 ms
100,548 KB
testcase_30 AC 629 ms
154,620 KB
testcase_31 AC 671 ms
210,320 KB
testcase_32 AC 663 ms
195,788 KB
testcase_33 AC 576 ms
136,312 KB
testcase_34 AC 637 ms
166,484 KB
testcase_35 AC 633 ms
158,176 KB
testcase_36 AC 634 ms
166,528 KB
testcase_37 AC 632 ms
154,852 KB
testcase_38 AC 641 ms
180,060 KB
testcase_39 AC 608 ms
163,188 KB
testcase_40 AC 604 ms
163,396 KB
testcase_41 AC 608 ms
163,592 KB
testcase_42 AC 529 ms
92,888 KB
testcase_43 AC 531 ms
93,012 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