結果
| 問題 |
No.2821 A[i] ← 2A[j] - A[i]
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-26 22:26:05 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 70 ms / 1,500 ms |
| コード長 | 452 bytes |
| コンパイル時間 | 2,290 ms |
| コンパイル使用メモリ | 195,284 KB |
| 最終ジャッジ日時 | 2025-02-23 18:45:09 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 33 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr int MOD=998244353;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,l,r) for(int i=(l);i<(int)(r);i++)
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin>>N;
vector A(N,0ll);
for(ll &i:A)cin>>i;
ll ans=0;
rep(i,N){
if(i==0){
cout<<"0\n";
}else{
ans=gcd(ans,abs(A[i-1]-A[i]));
cout<<ans<<'\n';
}
}
}