結果

問題 No.2074 Product is Square ?
ユーザー とりゐ
提出日時 2022-09-17 01:53:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 70,420 KB
最終ジャッジ日時 2024-12-22 00:04:48
合計ジャッジ時間 2,797 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import isqrt

def solve():
  n=int(input())
  a=list(map(int,input().split()))
  tmp=1
  for i in a:
    tmp*=i
  s=isqrt(tmp)
  if s*s==tmp:
    print('Yes')
  else:
    print('No')

for _ in range(int(input())):
  solve()
0