結果

問題 No.983 Convolution
ユーザー vwxyzvwxyz
提出日時 2021-09-15 13:42:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 849 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 29,264 KB
最終ジャッジ日時 2023-09-10 23:09:16
合計ジャッジ時間 5,380 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,316 KB
testcase_01 AC 32 ms
10,332 KB
testcase_02 AC 32 ms
10,400 KB
testcase_03 AC 109 ms
23,016 KB
testcase_04 AC 93 ms
20,852 KB
testcase_05 AC 86 ms
18,528 KB
testcase_06 AC 118 ms
23,940 KB
testcase_07 AC 120 ms
23,568 KB
testcase_08 AC 49 ms
12,704 KB
testcase_09 AC 64 ms
14,928 KB
testcase_10 AC 42 ms
12,028 KB
testcase_11 AC 49 ms
13,104 KB
testcase_12 AC 137 ms
26,220 KB
testcase_13 AC 58 ms
15,184 KB
testcase_14 AC 67 ms
15,788 KB
testcase_15 AC 106 ms
22,096 KB
testcase_16 AC 84 ms
18,124 KB
testcase_17 AC 118 ms
24,148 KB
testcase_18 AC 46 ms
12,288 KB
testcase_19 AC 81 ms
19,112 KB
testcase_20 AC 136 ms
26,012 KB
testcase_21 AC 99 ms
23,468 KB
testcase_22 AC 50 ms
12,776 KB
testcase_23 AC 104 ms
20,168 KB
testcase_24 AC 49 ms
12,816 KB
testcase_25 AC 46 ms
12,420 KB
testcase_26 AC 78 ms
16,592 KB
testcase_27 AC 66 ms
15,120 KB
testcase_28 AC 87 ms
19,784 KB
testcase_29 AC 134 ms
29,264 KB
testcase_30 AC 86 ms
19,772 KB
testcase_31 AC 61 ms
15,636 KB
testcase_32 AC 89 ms
21,072 KB
testcase_33 AC 33 ms
10,408 KB
testcase_34 AC 34 ms
10,404 KB
testcase_35 AC 33 ms
10,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import copy
import decimal
import fractions
import functools
import heapq
import itertools
import math
import random
import sys
from collections import Counter,deque,defaultdict
from functools import lru_cache,reduce
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
from math import degrees, gcd as GCD
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines

N=int(readline())
A=list(map(int,readline().split()))
for i in range(N):
    if A[i]==-1:
        A[i]=0
g=0
for a in A:
    g=GCD(g,a)
g**=2
if g==0:
    g=-1
print(g)
0