結果
| 問題 | No.2074 Product is Square ? |
| コンテスト | |
| ユーザー |
k1suxu
|
| 提出日時 | 2022-09-16 23:50:31 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 419 bytes |
| 記録 | |
| コンパイル時間 | 232 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 123,520 KB |
| 最終ジャッジ日時 | 2026-05-28 11:05:01 |
| 合計ジャッジ時間 | 4,969 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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