結果

問題 No.2821 A[i] ← 2A[j] - A[i]
ユーザー Nzt3Nzt3
提出日時 2024-07-26 22:26:05
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 62 ms / 1,500 ms
コード長 452 bytes
コンパイル時間 1,887 ms
コンパイル使用メモリ 203,736 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-26 22:26:11
合計ジャッジ時間 4,347 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 42 ms
6,940 KB
testcase_02 AC 62 ms
6,940 KB
testcase_03 AC 62 ms
6,940 KB
testcase_04 AC 41 ms
6,944 KB
testcase_05 AC 38 ms
6,944 KB
testcase_06 AC 25 ms
6,940 KB
testcase_07 AC 23 ms
6,940 KB
testcase_08 AC 35 ms
6,940 KB
testcase_09 AC 11 ms
6,940 KB
testcase_10 AC 14 ms
6,940 KB
testcase_11 AC 13 ms
6,940 KB
testcase_12 AC 13 ms
6,944 KB
testcase_13 AC 13 ms
6,944 KB
testcase_14 AC 13 ms
6,940 KB
testcase_15 AC 17 ms
6,944 KB
testcase_16 AC 10 ms
6,940 KB
testcase_17 AC 13 ms
6,940 KB
testcase_18 AC 18 ms
6,940 KB
testcase_19 AC 4 ms
6,940 KB
testcase_20 AC 3 ms
6,944 KB
testcase_21 AC 2 ms
6,940 KB
testcase_22 AC 2 ms
6,940 KB
testcase_23 AC 3 ms
6,940 KB
testcase_24 AC 1 ms
6,940 KB
testcase_25 AC 2 ms
6,940 KB
testcase_26 AC 2 ms
6,948 KB
testcase_27 AC 2 ms
6,944 KB
testcase_28 AC 2 ms
6,944 KB
testcase_29 AC 2 ms
6,940 KB
testcase_30 AC 2 ms
6,944 KB
testcase_31 AC 1 ms
6,940 KB
testcase_32 AC 2 ms
6,940 KB
testcase_33 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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';
    }
  }
}
0