結果
問題 |
No.2074 Product is Square ?
|
ユーザー |
|
提出日時 | 2022-09-16 23:10:44 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 357 bytes |
コンパイル時間 | 356 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 86,272 KB |
最終ジャッジ日時 | 2024-12-21 22:43:01 |
合計ジャッジ時間 | 97,644 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 TLE * 32 |
ソースコード
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) for i in range(min(0, sq-5), sq+5): if sq ** 2 == now: now = 1 if now == 1: print('Yes') else: print('No')