結果
| 問題 |
No.1665 quotient replace
|
| コンテスト | |
| ユーザー |
asumo0729
|
| 提出日時 | 2021-09-03 23:13:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 276 ms / 3,000 ms |
| コード長 | 969 bytes |
| コンパイル時間 | 498 ms |
| コンパイル使用メモリ | 82,364 KB |
| 実行使用メモリ | 243,652 KB |
| 最終ジャッジ日時 | 2024-12-15 17:36:24 |
| 合計ジャッジ時間 | 9,123 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
import sys
from operator import itemgetter
stdin=sys.stdin
sys.setrecursionlimit(10 ** 8)
ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
Yp=lambda:print('Yes')
Np=lambda:print('No')
inf = 1 << 60
eps = 1e-9
sortkey = itemgetter(0)
def primes(n):
is_prime = [True] * (n + 1)
is_prime[0] = False
is_prime[1] = False
for i in range(2, int(n**0.5) + 1):
if not is_prime[i]:
continue
for j in range(i * 2, n + 1, i):
is_prime[j] = False
return [i for i in range(n + 1) if is_prime[i]]
N = ip()
A = lp()
B = [0 for _ in range(10 ** 6 + 1)]
prime = primes(10 ** 6)
for get in prime:
now = get
while now < 10 ** 6:
temp = now
while temp <= 10 ** 6:
B[temp] += 1
temp += now
now *= get
x = 0
for get in A:
x ^= B[get]
if not x:
print("black")
else:
print("white")
asumo0729