結果
問題 | No.2074 Product is Square ? |
ユーザー |
|
提出日時 | 2022-09-16 22:50:26 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 583 bytes |
コンパイル時間 | 314 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 157,312 KB |
最終ジャッジ日時 | 2024-12-21 22:12:04 |
合計ジャッジ時間 | 63,546 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 TLE * 20 |
ソースコード
# https://sky-time-math.hatenablog.jp/entry/2020/09/08/153230def intsqrt(n):dig=0while pow(10,2*dig) < n:dig+=1sq=0for k in reversed(range(0,dig+1)):for l in range(0,10):sq+=10**kif sq*sq==n:breakif sq*sq>n:sq-=10**kbreakreturn sqt = int(input())for _ in range(t):n = int(input())a = list(map(int, input().split()))p = 1for v in a:p *= vrt = intsqrt(p)print("Yes" if rt * rt == p else "No")