結果

問題 No.1665 quotient replace
ユーザー 👑 H20H20
提出日時 2021-09-03 22:12:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 582 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 82,100 KB
実行使用メモリ 266,520 KB
最終ジャッジ日時 2024-05-09 04:22:57
合計ジャッジ時間 10,534 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 103 ms
84,224 KB
testcase_03 AC 97 ms
84,864 KB
testcase_04 AC 101 ms
84,560 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 101 ms
87,424 KB
testcase_09 AC 110 ms
93,344 KB
testcase_10 WA -
testcase_11 AC 279 ms
184,196 KB
testcase_12 AC 123 ms
105,344 KB
testcase_13 AC 385 ms
266,384 KB
testcase_14 AC 382 ms
266,392 KB
testcase_15 AC 379 ms
266,260 KB
testcase_16 AC 384 ms
266,388 KB
testcase_17 WA -
testcase_18 AC 97 ms
84,344 KB
testcase_19 AC 103 ms
84,224 KB
testcase_20 AC 98 ms
84,480 KB
testcase_21 AC 97 ms
84,180 KB
testcase_22 AC 103 ms
84,224 KB
testcase_23 AC 96 ms
84,540 KB
testcase_24 AC 102 ms
84,608 KB
testcase_25 AC 95 ms
84,480 KB
testcase_26 AC 103 ms
86,144 KB
testcase_27 AC 106 ms
87,580 KB
testcase_28 AC 109 ms
93,236 KB
testcase_29 AC 122 ms
100,864 KB
testcase_30 AC 226 ms
168,236 KB
testcase_31 AC 283 ms
196,720 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 255 ms
181,932 KB
testcase_35 AC 232 ms
169,020 KB
testcase_36 AC 241 ms
179,280 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 216 ms
157,616 KB
testcase_40 AC 219 ms
157,744 KB
testcase_41 AC 216 ms
158,052 KB
testcase_42 AC 96 ms
84,224 KB
testcase_43 AC 101 ms
84,224 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%2==1 or np==1:
    print('white')
else:
    print('black')
0