結果

問題 No.1665 quotient replace
ユーザー shiroha_F14shiroha_F14
提出日時 2021-08-11 21:15:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,521 ms / 3,000 ms
コード長 438 bytes
コンパイル時間 725 ms
コンパイル使用メモリ 10,832 KB
実行使用メモリ 124,764 KB
最終ジャッジ日時 2023-08-21 18:56:34
合計ジャッジ時間 51,626 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 562 ms
18,680 KB
testcase_01 AC 553 ms
18,564 KB
testcase_02 AC 591 ms
18,584 KB
testcase_03 AC 586 ms
18,628 KB
testcase_04 AC 569 ms
18,400 KB
testcase_05 AC 581 ms
18,480 KB
testcase_06 AC 571 ms
18,568 KB
testcase_07 AC 595 ms
18,544 KB
testcase_08 AC 590 ms
18,560 KB
testcase_09 AC 617 ms
19,836 KB
testcase_10 AC 1,194 ms
47,292 KB
testcase_11 AC 2,011 ms
96,372 KB
testcase_12 AC 743 ms
22,716 KB
testcase_13 AC 2,336 ms
124,764 KB
testcase_14 AC 2,346 ms
124,684 KB
testcase_15 AC 2,353 ms
124,576 KB
testcase_16 AC 2,521 ms
124,692 KB
testcase_17 AC 2,464 ms
124,552 KB
testcase_18 AC 564 ms
18,444 KB
testcase_19 AC 559 ms
18,484 KB
testcase_20 AC 580 ms
18,628 KB
testcase_21 AC 578 ms
18,672 KB
testcase_22 AC 583 ms
18,448 KB
testcase_23 AC 571 ms
18,468 KB
testcase_24 AC 580 ms
18,504 KB
testcase_25 AC 608 ms
18,484 KB
testcase_26 AC 616 ms
18,816 KB
testcase_27 AC 580 ms
18,976 KB
testcase_28 AC 627 ms
20,568 KB
testcase_29 AC 649 ms
21,948 KB
testcase_30 AC 1,087 ms
67,308 KB
testcase_31 AC 1,361 ms
98,656 KB
testcase_32 AC 1,928 ms
92,360 KB
testcase_33 AC 1,091 ms
39,796 KB
testcase_34 AC 1,596 ms
75,892 KB
testcase_35 AC 1,597 ms
69,912 KB
testcase_36 AC 1,590 ms
72,940 KB
testcase_37 AC 1,492 ms
66,988 KB
testcase_38 AC 1,688 ms
76,528 KB
testcase_39 AC 1,352 ms
54,776 KB
testcase_40 AC 1,423 ms
54,792 KB
testcase_41 AC 1,321 ms
54,808 KB
testcase_42 AC 570 ms
18,528 KB
testcase_43 AC 592 ms
18,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))

spl = [0 for _ in range(1000001)]
spl[1] = 1
for i in range(2, 1000001):
  if spl[i] : continue;
  for j in range(i, 1000001, i):
    spl[j] = i

grundy = [0 for _ in range(n)]
for i in range(n):
  while a[i] > 1:
    a[i] //= spl[a[i]]
    grundy[i] += 1

nimber = 0
for i in range(n):
  nimber ^= grundy[i]
print("white" if nimber else "black")
0