結果

問題 No.2074 Product is Square ?
ユーザー prussian_coderprussian_coder
提出日時 2022-09-18 15:38:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 527 ms / 2,000 ms
コード長 360 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 77,760 KB
最終ジャッジ日時 2023-08-23 18:09:38
合計ジャッジ時間 10,729 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
72,108 KB
testcase_01 AC 92 ms
77,284 KB
testcase_02 AC 94 ms
77,304 KB
testcase_03 AC 103 ms
77,760 KB
testcase_04 AC 91 ms
76,916 KB
testcase_05 AC 90 ms
77,144 KB
testcase_06 AC 95 ms
76,876 KB
testcase_07 AC 90 ms
77,384 KB
testcase_08 AC 90 ms
77,412 KB
testcase_09 AC 93 ms
77,048 KB
testcase_10 AC 88 ms
77,380 KB
testcase_11 AC 358 ms
77,004 KB
testcase_12 AC 346 ms
77,424 KB
testcase_13 AC 527 ms
76,948 KB
testcase_14 AC 360 ms
76,932 KB
testcase_15 AC 359 ms
77,272 KB
testcase_16 AC 338 ms
77,324 KB
testcase_17 AC 523 ms
77,104 KB
testcase_18 AC 347 ms
77,116 KB
testcase_19 AC 346 ms
77,300 KB
testcase_20 AC 334 ms
76,944 KB
testcase_21 AC 525 ms
77,344 KB
testcase_22 AC 354 ms
77,284 KB
testcase_23 AC 346 ms
77,336 KB
testcase_24 AC 330 ms
77,432 KB
testcase_25 AC 518 ms
77,320 KB
testcase_26 AC 347 ms
77,184 KB
testcase_27 AC 344 ms
77,100 KB
testcase_28 AC 322 ms
77,440 KB
testcase_29 AC 513 ms
77,408 KB
testcase_30 AC 343 ms
77,184 KB
testcase_31 AC 69 ms
71,548 KB
testcase_32 AC 68 ms
71,612 KB
testcase_33 AC 108 ms
77,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
import math
for _ in range(T):
	N=int(input())
	A=[int(x) for x in input().split()]
	A.sort()
	for i in range(N):
		for j in range(i+1,N):
			a=math.gcd(A[i],A[j])
			A[i]//=a
			A[j]//=a
	flag=True		
	for i in range(N):
		t=int((A[i])**0.5)
		if t**2!=A[i] and (t+1)**2!=A[i]:
			print("No")
			flag=False
			break
	if flag:
		print("Yes")
	
	
0