結果

問題 No.2074 Product is Square ?
ユーザー flygon
提出日時 2022-09-16 22:58:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 303 bytes
コンパイル時間 390 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 77,056 KB
最終ジャッジ日時 2024-12-21 22:25:17
合計ジャッジ時間 3,866 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13 WA * 15 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
t = int(input())
for i in range(t):
  n = int(input())
  a = list(map(int,input().split()))
  now = 1
  for i in range(n):
    g = gcd(now, a[i])
    now = (now//g)*(a[i]//g)
  sq = int(now**0.5)
  if sq**2 == now:
    now = 1
  if now == 1:
    print('Yes')
  else:
    print('No')
0