結果
| 問題 |
No.2821 A[i] ← 2A[j] - A[i]
|
| コンテスト | |
| ユーザー |
みどりむし🦠
|
| 提出日時 | 2023-09-01 21:23:09 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 558 bytes |
| コンパイル時間 | 967 ms |
| コンパイル使用メモリ | 109,628 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-26 20:50:34 |
| 合計ジャッジ時間 | 3,094 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 33 |
ソースコード
#include <cstdint>
#include <numeric>
#include <iostream>
#include <valarray>
using i64 = std::int64_t;
void solve() {
int n; std::cin >> n;
std::valarray<i64> a(n); for(i64& x : a) std::cin >> x;
i64 ans = 0;
for(int i = 0; ; ++i) {
std::cout << ans << " ";
if(i == n-1) break;
ans = std::gcd(ans, a[i+1] - a[i]);
}
std::cout << "\n";
return;
}
int main() {
solve();
return 0;
}
__attribute__((constructor)) inline void fast_io() { std::ios::sync_with_stdio(false), std::cin.tie(nullptr); }
みどりむし🦠