結果

問題 No.983 Convolution
ユーザー titiatitia
提出日時 2020-03-12 17:38:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 172 bytes
コンパイル時間 1,449 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 26,764 KB
最終ジャッジ日時 2023-08-12 01:35:32
合計ジャッジ時間 5,690 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,220 KB
testcase_01 AC 17 ms
8,060 KB
testcase_02 AC 17 ms
8,160 KB
testcase_03 AC 81 ms
20,812 KB
testcase_04 AC 70 ms
18,556 KB
testcase_05 AC 60 ms
16,452 KB
testcase_06 AC 86 ms
21,544 KB
testcase_07 AC 80 ms
21,236 KB
testcase_08 AC 30 ms
10,556 KB
testcase_09 AC 35 ms
12,580 KB
testcase_10 AC 24 ms
9,712 KB
testcase_11 AC 32 ms
11,028 KB
testcase_12 AC 87 ms
24,060 KB
testcase_13 AC 40 ms
12,996 KB
testcase_14 AC 45 ms
13,604 KB
testcase_15 AC 71 ms
19,860 KB
testcase_16 AC 55 ms
16,596 KB
testcase_17 AC 79 ms
22,036 KB
testcase_18 AC 27 ms
10,192 KB
testcase_19 AC 57 ms
16,196 KB
testcase_20 AC 92 ms
23,880 KB
testcase_21 AC 75 ms
21,024 KB
testcase_22 AC 28 ms
10,768 KB
testcase_23 AC 53 ms
17,940 KB
testcase_24 AC 24 ms
10,248 KB
testcase_25 AC 22 ms
9,968 KB
testcase_26 AC 40 ms
14,336 KB
testcase_27 AC 34 ms
12,892 KB
testcase_28 AC 60 ms
17,428 KB
testcase_29 AC 105 ms
26,764 KB
testcase_30 AC 59 ms
17,500 KB
testcase_31 AC 41 ms
13,264 KB
testcase_32 AC 66 ms
18,632 KB
testcase_33 AC 16 ms
8,192 KB
testcase_34 AC 15 ms
8,056 KB
testcase_35 AC 15 ms
8,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
from math import gcd
ANS=0
for a in A:
    if a!=-1:
        ANS=gcd(a,ANS)
if ANS==0:
    print(-1)
else:
    print(ANS**2)
0