結果

問題 No.2074 Product is Square ?
ユーザー shobonvipshobonvip
提出日時 2022-09-16 21:48:34
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 439 bytes
コンパイル時間 567 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 84,272 KB
最終ジャッジ日時 2023-08-23 14:51:31
合計ジャッジ時間 7,087 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
75,532 KB
testcase_01 AC 234 ms
77,840 KB
testcase_02 AC 201 ms
76,964 KB
testcase_03 AC 217 ms
77,812 KB
testcase_04 AC 201 ms
76,856 KB
testcase_05 AC 204 ms
76,776 KB
testcase_06 AC 209 ms
77,228 KB
testcase_07 AC 203 ms
76,956 KB
testcase_08 AC 205 ms
76,928 KB
testcase_09 AC 205 ms
76,808 KB
testcase_10 AC 208 ms
76,804 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def issquared(n):
    suki = n
    kirai = 0
    while suki - kirai > 1:
        targ = (suki + kirai)//2
        if targ ** 2 >= n:
            suki = targ
        else:
            kirai = targ
    if suki ** 2 == n:
        return True
    return False

T = int(input())
for _ in range(T):
	n = int(input())
	a = list(map(int,input().split()))
	d = 1
	for i in range(n):
		d *= a[i]
	if issquared(d):
		print("Yes")
	else:
		print("No")
0