0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-09 23:38:47 +00:00
OI-codes/Luogu/P4549/P4549.cpp

27 lines
392 B
C++

#include <iostream>
#include <cmath>
#include <experimental/numeric>
using std::cin;
using std::cout;
const char endl = '\n';
int n, ans;
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n;
for (int i = 1, x; i <= n; i++) {
cin >> x;
ans = std::experimental::gcd(ans, std::abs(x));
}
cout << ans << endl;
return 0;
}