結果

問題 No.2821 A[i] ← 2A[j] - A[i]
ユーザー miya145592
提出日時 2024-07-27 01:36:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 572 ms
コンパイル使用メモリ 82,476 KB
実行使用メモリ 155,576 KB
最終ジャッジ日時 2024-07-27 01:36:09
合計ジャッジ時間 5,671 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
ans = [0]
for i in range(1, N):
    if ans[-1]==0:
        ans.append(abs(A[i]-A[i-1]))
    else:
        ans.append(math.gcd(ans[-1], A[i]))
for a in ans:
    print(a)
0