結果
| 問題 | No.2074 Product is Square ? |
| コンテスト | |
| ユーザー |
k1suxu
|
| 提出日時 | 2022-09-16 23:50:31 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 419 bytes |
| 記録 | |
| コンパイル時間 | 64 ms |
| コンパイル使用メモリ | 81,632 KB |
| 実行使用メモリ | 166,300 KB |
| 最終ジャッジ日時 | 2026-10-05 19:05:38 |
| 合計ジャッジ時間 | 7,061 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 TLE * 1 -- * 22 |
ソースコード
def is_square(apositiveint):
x = apositiveint // 2
seen = set([x])
while x * x != apositiveint:
x = (x + (apositiveint // x)) // 2
if x in seen: return False
seen.add(x)
return True
t = int(input())
for i in range(t):
n = int(input())
a = list(map(int, input().split()))
mul = 1
for e in a:
mul *= e
if is_square(mul):
print("Yes")
else:
print("No")
k1suxu