結果

問題 No.2074 Product is Square ?
ユーザー 👑 H20H20
提出日時 2022-09-16 23:11:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 294 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 77,324 KB
最終ジャッジ日時 2023-08-23 16:34:36
合計ジャッジ時間 5,364 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,484 KB
testcase_01 AC 92 ms
76,712 KB
testcase_02 AC 90 ms
76,816 KB
testcase_03 AC 90 ms
76,608 KB
testcase_04 AC 89 ms
76,844 KB
testcase_05 AC 96 ms
76,488 KB
testcase_06 AC 87 ms
76,576 KB
testcase_07 AC 89 ms
76,764 KB
testcase_08 AC 90 ms
76,976 KB
testcase_09 AC 89 ms
76,672 KB
testcase_10 AC 89 ms
76,484 KB
testcase_11 AC 88 ms
76,784 KB
testcase_12 AC 99 ms
76,788 KB
testcase_13 AC 140 ms
77,140 KB
testcase_14 AC 102 ms
76,972 KB
testcase_15 AC 90 ms
76,736 KB
testcase_16 AC 103 ms
76,996 KB
testcase_17 AC 141 ms
77,324 KB
testcase_18 AC 101 ms
76,616 KB
testcase_19 AC 89 ms
76,640 KB
testcase_20 AC 101 ms
76,804 KB
testcase_21 AC 139 ms
77,224 KB
testcase_22 AC 101 ms
76,768 KB
testcase_23 AC 91 ms
76,924 KB
testcase_24 AC 103 ms
76,592 KB
testcase_25 AC 139 ms
77,108 KB
testcase_26 AC 101 ms
76,784 KB
testcase_27 AC 91 ms
76,780 KB
testcase_28 AC 102 ms
76,860 KB
testcase_29 AC 139 ms
77,244 KB
testcase_30 AC 101 ms
76,552 KB
testcase_31 AC 79 ms
71,748 KB
testcase_32 AC 76 ms
71,424 KB
testcase_33 AC 114 ms
77,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
T = int(input())
for _ in range(T):
    N = int(input())
    A = list(map(int, input().split())) 
    v = 1
    for a in A:
        g = math.gcd(v,a)
        a = a//g
        v = v//g
        v = v*a
    if v == math.isqrt(v)**2:
        print('Yes')
    else:
        print('No')

0