結果
問題 | No.2074 Product is Square ? |
ユーザー |
![]() |
提出日時 | 2022-09-16 23:47:17 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 477 ms / 2,000 ms |
コード長 | 614 bytes |
コンパイル時間 | 423 ms |
コンパイル使用メモリ | 82,296 KB |
実行使用メモリ | 74,588 KB |
最終ジャッジ日時 | 2024-12-21 23:29:59 |
合計ジャッジ時間 | 9,467 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 33 |
ソースコード
import sysinput = sys.stdin.readlinefrom collections import *from math import gcdfor _ in range(int(input())):N = int(input())A = list(map(int, input().split()))for i in range(N):for j in range(i+1, N):G = gcd(A[i], A[j])A[i] //= GA[j] //= Gfor Ai in A:l, r = 0, Aiwhile l<=r:m = (l+r)//2if m*m<=Ai:l = m+1else:r = m-1if r*r!=Ai:print('No')breakelse:print('Yes')