結果
| 問題 | 
                            No.983 Convolution
                             | 
                    
| コンテスト | |
| ユーザー | 
                             tamato
                         | 
                    
| 提出日時 | 2020-02-11 14:29:37 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 334 bytes | 
| コンパイル時間 | 153 ms | 
| コンパイル使用メモリ | 81,848 KB | 
| 実行使用メモリ | 88,776 KB | 
| 最終ジャッジ日時 | 2024-10-01 07:40:10 | 
| 合計ジャッジ時間 | 6,357 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()))
    if sum(A) == -N:
        print(-1)
        exit()
    g = 0
    for a in A:
        if a != -1:
            g = gcd(g, a)
    print(g**2)
if __name__ == '__main__':
    main()
            
            
            
        
            
tamato