結果

問題 No.2074 Product is Square ?
ユーザー titiatitia
提出日時 2022-09-20 03:29:17
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 524 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 77,672 KB
最終ジャッジ日時 2023-08-23 19:19:41
合計ジャッジ時間 10,815 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,828 KB
testcase_01 AC 123 ms
77,272 KB
testcase_02 AC 95 ms
77,276 KB
testcase_03 AC 90 ms
77,116 KB
testcase_04 AC 90 ms
77,196 KB
testcase_05 AC 89 ms
77,188 KB
testcase_06 AC 92 ms
77,132 KB
testcase_07 AC 88 ms
77,060 KB
testcase_08 AC 88 ms
77,120 KB
testcase_09 AC 91 ms
76,852 KB
testcase_10 AC 86 ms
77,424 KB
testcase_11 AC 339 ms
77,164 KB
testcase_12 AC 318 ms
77,672 KB
testcase_13 AC 520 ms
77,444 KB
testcase_14 AC 342 ms
77,240 KB
testcase_15 AC 342 ms
77,120 KB
testcase_16 AC 320 ms
77,236 KB
testcase_17 AC 524 ms
77,340 KB
testcase_18 AC 351 ms
77,456 KB
testcase_19 AC 341 ms
77,356 KB
testcase_20 AC 324 ms
77,212 KB
testcase_21 AC 520 ms
77,220 KB
testcase_22 AC 346 ms
77,412 KB
testcase_23 AC 341 ms
77,324 KB
testcase_24 AC 320 ms
77,284 KB
testcase_25 AC 518 ms
77,244 KB
testcase_26 AC 346 ms
77,248 KB
testcase_27 AC 341 ms
77,456 KB
testcase_28 AC 319 ms
77,352 KB
testcase_29 AC 514 ms
77,164 KB
testcase_30 AC 346 ms
77,348 KB
testcase_31 AC 73 ms
71,552 KB
testcase_32 AC 72 ms
71,856 KB
testcase_33 AC 94 ms
77,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from math import gcd

T=int(input())
for tests in range(T):
    N=int(input())
    A=list(map(int,input().split()))
    for i in range(N):
        for j in range(i+1,N):
            x=gcd(A[i],A[j])
            if x!=1:
                A[i]//=x
                A[j]//=x
                
    for a in A:
        x=round(a**(1/2))
        if x*x==a:
            pass
        else:
            print("No")
            break
    else:
        print("Yes")
0