結果
問題 | No.2821 A[i] ← 2A[j] - A[i] |
ユーザー |
![]() |
提出日時 | 2024-07-26 21:57:43 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 71 ms / 1,500 ms |
コード長 | 372 bytes |
コンパイル時間 | 2,872 ms |
コンパイル使用メモリ | 245,844 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-26 21:57:54 |
合計ジャッジ時間 | 5,514 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h> using namespace std; void Solve() { int n; cin >> n; vector<int64_t> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } int64_t g = 0; for (int i = 0; i < n; ++i) { if (i) { g = gcd(g, a[i] - a[i - 1]); } cout << g << '\n'; } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); Solve(); }