結果
| 問題 | 
                            No.983 Convolution
                             | 
                    
| コンテスト | |
| ユーザー | 
                             tamato
                         | 
                    
| 提出日時 | 2020-02-11 14:31:35 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 326 bytes | 
| コンパイル時間 | 204 ms | 
| コンパイル使用メモリ | 82,256 KB | 
| 実行使用メモリ | 88,784 KB | 
| 最終ジャッジ日時 | 2024-10-01 07:40:37 | 
| 合計ジャッジ時間 | 6,058 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | RE * 3 | 
| other | RE * 33 | 
ソースコード
def main():
    import sys
    from fractions import gcd
    input = sys.stdin.readline
    N = int(input())
    A = list(map(int, input().split()))
    g = 0
    for a in A:
        if a != -1:
            g = gcd(g, a)
    if g == 0:
        print(g**2)
    else:
        print(-1)
if __name__ == '__main__':
    main()
            
            
            
        
            
tamato