結果

問題 No.2074 Product is Square ?
ユーザー H20H20
提出日時 2022-09-16 23:11:21
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 294 bytes
コンパイル時間 262 ms
使用メモリ 82,388 KB
最終ジャッジ日時 2023-01-11 08:25:15
合計ジャッジ時間 5,502 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 81 ms
75,828 KB
testcase_01 AC 98 ms
81,008 KB
testcase_02 AC 97 ms
81,012 KB
testcase_03 AC 97 ms
81,012 KB
testcase_04 AC 96 ms
80,948 KB
testcase_05 AC 95 ms
80,972 KB
testcase_06 AC 95 ms
81,240 KB
testcase_07 AC 97 ms
81,048 KB
testcase_08 AC 95 ms
81,108 KB
testcase_09 AC 95 ms
81,152 KB
testcase_10 AC 95 ms
80,964 KB
testcase_11 AC 95 ms
80,920 KB
testcase_12 AC 105 ms
81,004 KB
testcase_13 AC 146 ms
81,404 KB
testcase_14 AC 107 ms
80,976 KB
testcase_15 AC 93 ms
81,036 KB
testcase_16 AC 107 ms
81,000 KB
testcase_17 AC 146 ms
81,444 KB
testcase_18 AC 106 ms
81,008 KB
testcase_19 AC 93 ms
80,916 KB
testcase_20 AC 104 ms
81,044 KB
testcase_21 AC 144 ms
81,424 KB
testcase_22 AC 105 ms
81,036 KB
testcase_23 AC 92 ms
81,092 KB
testcase_24 AC 104 ms
80,960 KB
testcase_25 AC 146 ms
81,380 KB
testcase_26 AC 106 ms
81,060 KB
testcase_27 AC 94 ms
81,008 KB
testcase_28 AC 106 ms
80,976 KB
testcase_29 AC 145 ms
81,388 KB
testcase_30 AC 108 ms
81,008 KB
testcase_31 AC 86 ms
75,784 KB
testcase_32 AC 80 ms
75,832 KB
testcase_33 AC 135 ms
82,388 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