結果

問題 No.1665 quotient replace
ユーザー 👑 H20H20
提出日時 2021-09-03 22:17:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 587 bytes
コンパイル時間 498 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 259,224 KB
最終ジャッジ日時 2023-08-21 22:26:40
合計ジャッジ時間 10,973 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
97,116 KB
testcase_01 WA -
testcase_02 AC 123 ms
97,016 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 122 ms
96,980 KB
testcase_06 WA -
testcase_07 AC 125 ms
97,524 KB
testcase_08 WA -
testcase_09 AC 130 ms
100,512 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 140 ms
109,560 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 323 ms
257,848 KB
testcase_16 AC 328 ms
258,500 KB
testcase_17 WA -
testcase_18 AC 122 ms
96,940 KB
testcase_19 AC 122 ms
97,084 KB
testcase_20 AC 121 ms
97,148 KB
testcase_21 AC 120 ms
97,044 KB
testcase_22 AC 121 ms
96,996 KB
testcase_23 AC 121 ms
96,992 KB
testcase_24 AC 124 ms
96,908 KB
testcase_25 AC 121 ms
97,208 KB
testcase_26 AC 122 ms
97,660 KB
testcase_27 AC 125 ms
97,808 KB
testcase_28 AC 131 ms
101,016 KB
testcase_29 AC 138 ms
106,920 KB
testcase_30 AC 217 ms
171,332 KB
testcase_31 AC 274 ms
211,652 KB
testcase_32 AC 252 ms
184,056 KB
testcase_33 AC 186 ms
128,844 KB
testcase_34 AC 247 ms
185,880 KB
testcase_35 WA -
testcase_36 AC 242 ms
183,600 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 123 ms
97,064 KB
testcase_43 AC 124 ms
97,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def sieve(n):
    is_prime = [True for _ in range(n+1)]
    is_prime[0] = False

    for i in range(2, n+1):
        if is_prime[i-1]:
            j = i * i
            while j <= n:
                is_prime[j-1] = False
                j += i
    table = [ i for i in range(1, n+1) if is_prime[i-1]]
    return [False]+is_prime, table



N = int(input())
A = list(map(int, input().split())) 
T,_ =  sieve(10**6+1)
p = 0
np = 0
for a in A:
    if a>1: 
        if T[a]:
            p+=1
        else:
            np+=1
if (p+np)%2==1 or np==1:
    print('white')
else:
    print('black')
0