結果
| 問題 | No.2074 Product is Square ? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-16 22:27:48 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 480 bytes |
| 記録 | |
| コンパイル時間 | 168 ms |
| コンパイル使用メモリ | 84,864 KB |
| 実行使用メモリ | 89,344 KB |
| 最終ジャッジ日時 | 2026-05-28 10:23:01 |
| 合計ジャッジ時間 | 4,791 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | TLE * 1 -- * 32 |
ソースコード
import math
from queue import Queue
def solve() :
N = int(input())
A = list(map(int, input().split()))
que = Queue()
for a in A :
que.put(a)
for i in range(N-1) :
a = que.get()
b = que.get()
que.put(a * b)
ret = que.get()
pk = math.sqrt(ret)
pk -= 5
while pk * pk < ret :
pk += 1
if pk * pk == ret :
print("Yes")
else :
print("No")
T = int(input())
for i in range(T) :
solve()