mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-08 12:58:48 +00:00
parent
a9cd8b6002
commit
62ffd92f58
26
Luogu/P4549/P4549.cpp
Normal file
26
Luogu/P4549/P4549.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user