結果

問題 No.2751 429-like Number
ユーザー ryohei22
提出日時 2024-05-10 22:01:02
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 2,273 ms / 4,000 ms
+ 365µs
コード長 328 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 93 ms
コンパイル使用メモリ 64,636 KB
実行使用メモリ 60,664 KB
最終ジャッジ日時 2026-10-20 23:08:07
合計ジャッジ時間 21,051 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def f(n):
	if n == 1:
		return 0

	init = n
	i = 2
	cnt = 0
	while 1 < n and cnt < 4:
		if init < i**2:
			break
		if n % i == 0:
			while n % i == 0:
				n //= i
				cnt += 1
		i += 1

	if n != 1:
		cnt += 1
	return cnt == 3


Q = int(input())
for _ in range(Q):
	a = int(input())
	if f(a):
		print('Yes')
	else:
		print('No')
0