結果
問題 | No.1665 quotient replace |
ユーザー |
|
提出日時 | 2021-09-04 13:35:05 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 568 ms / 3,000 ms |
コード長 | 414 bytes |
コンパイル時間 | 336 ms |
コンパイル使用メモリ | 82,120 KB |
実行使用メモリ | 262,312 KB |
最終ジャッジ日時 | 2024-12-17 22:52:19 |
合計ジャッジ時間 | 11,109 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 41 |
ソースコード
N = int(input()) A = list(map(int, input().split())) # 素数列挙 mx = 10 ** 6 div = [0] * (mx + 1) div[1] = 1 for i in range(2, mx + 1): if div[i]: continue for j in range(i, mx + 1, i): div[j] = i #素因数分解 cnt = [0] * N for i in range(N): while A[i] > 1: A[i] //= div[A[i]] cnt[i] += 1 # XOR x = 0 for c in cnt: x ^= c print(["black", "white"][x > 0])