結果
| 問題 | No.2821 A[i] ← 2A[j] - A[i] |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-07-08 22:58:47 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 1,500 ms |
| コード長 | 319 bytes |
| 記録 | |
| コンパイル時間 | 1,101 ms |
| コンパイル使用メモリ | 207,568 KB |
| 実行使用メモリ | 9,232 KB |
| 最終ジャッジ日時 | 2026-07-08 22:58:54 |
| 合計ジャッジ時間 | 3,570 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 33 |
ソースコード
#include <bits/stdc++.h>
using LL = long long;
const int N = 1e6 + 7;
LL a[N], ans;
int n;
int main() {
scanf("%d", &n);
for(int i = 1; i <= n; ++i)
scanf("%lld", &a[i]);
for(int i = 1; i <= n; ++i) {
ans = std::__gcd(ans, std::abs(a[i] - a[1]));
printf("%lld\n", ans);
}
return 0;
}