結果
問題 | No.1665 quotient replace |
ユーザー |
![]() |
提出日時 | 2021-09-03 22:25:31 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 924 bytes |
コンパイル時間 | 433 ms |
コンパイル使用メモリ | 82,628 KB |
実行使用メモリ | 318,664 KB |
最終ジャッジ日時 | 2024-12-15 14:31:37 |
合計ジャッジ時間 | 79,072 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 1 TLE * 18 |
ソースコード
import sysfrom operator import itemgetterstdin=sys.stdinsys.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 << 60eps = 1e-9sortkey = itemgetter(0)N = ip()A = lp()def factorization(n):arr = []temp = nres = 0for i in range(2, int(-(-n**0.5//1))+1):if temp%i==0:cnt=0while temp%i==0:cnt+=1temp //= iarr.append([i, cnt])res += cntif temp!=1:arr.append([temp, 1])res += 1if arr==[]:arr.append([n, 1])res += 1return resNim = []for get in A:res = factorization(get)Nim.append(res)x = 0for get in Nim:x ^= getif not x:print("black")else:print("white")