結果
| 問題 |
No.2074 Product is Square ?
|
| コンテスト | |
| ユーザー |
prussian_coder
|
| 提出日時 | 2022-09-18 15:36:08 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 355 bytes |
| コンパイル時間 | 2,370 ms |
| コンパイル使用メモリ | 82,540 KB |
| 実行使用メモリ | 74,980 KB |
| 最終ジャッジ日時 | 2024-12-22 01:20:07 |
| 合計ジャッジ時間 | 9,454 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 15 WA * 18 |
ソースコード
T=int(input())
import math
for _ in range(T):
N=int(input())
A=[int(x) for x in input().split()]
A.sort()
for i in range(N):
for j in range(i+1,N):
a=math.gcd(A[i],A[j])
A[i]//=a
A[j]//=a
flag=True
for i in range(N):
t=(A[i])**0.5
if t**2!=A[i] and (t+1)**2!=A[i]:
print("No")
flag=False
break
if flag:
print("Yes")
prussian_coder