結果
| 問題 |
No.2821 A[i] ← 2A[j] - A[i]
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-26 23:22:00 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 536 bytes |
| コンパイル時間 | 2,748 ms |
| コンパイル使用メモリ | 246,420 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-26 23:22:09 |
| 合計ジャッジ時間 | 8,099 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 33 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1<<30;
const long long INFLL = 1LL<<60;
const int MOD = 998244343;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n; cin >> n;
vector<ll> a(n);
for (int i = 0; i < n; i++) cin >> a[i];
cout << 0 << endl;
cout << a[1] - a[0] << endl;
ll g = a[1] - a[0];
for (int i = 2; i < n; i++){
ll b = abs(a[i] - a[i-1]);
g = gcd(g, b);
cout << g << endl;
}
cout << endl;
}