結果
問題 | No.2074 Product is Square ? |
ユーザー | flygon |
提出日時 | 2022-09-16 22:58:47 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 303 bytes |
コンパイル時間 | 284 ms |
コンパイル使用メモリ | 87,000 KB |
実行使用メモリ | 80,584 KB |
最終ジャッジ日時 | 2023-08-23 16:28:21 |
合計ジャッジ時間 | 4,995 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 66 ms
71,448 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 78 ms
76,684 KB |
testcase_12 | AC | 92 ms
76,616 KB |
testcase_13 | RE | - |
testcase_14 | WA | - |
testcase_15 | AC | 77 ms
76,736 KB |
testcase_16 | AC | 92 ms
76,776 KB |
testcase_17 | RE | - |
testcase_18 | WA | - |
testcase_19 | AC | 80 ms
76,760 KB |
testcase_20 | AC | 91 ms
76,912 KB |
testcase_21 | RE | - |
testcase_22 | WA | - |
testcase_23 | AC | 78 ms
76,552 KB |
testcase_24 | AC | 91 ms
76,724 KB |
testcase_25 | RE | - |
testcase_26 | WA | - |
testcase_27 | AC | 79 ms
76,660 KB |
testcase_28 | AC | 91 ms
76,692 KB |
testcase_29 | RE | - |
testcase_30 | WA | - |
testcase_31 | AC | 71 ms
71,776 KB |
testcase_32 | AC | 68 ms
71,492 KB |
testcase_33 | AC | 104 ms
77,480 KB |
ソースコード
from math import gcd t = int(input()) for i in range(t): n = int(input()) a = list(map(int,input().split())) now = 1 for i in range(n): g = gcd(now, a[i]) now = (now//g)*(a[i]//g) sq = int(now**0.5) if sq**2 == now: now = 1 if now == 1: print('Yes') else: print('No')