0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-08 21:38:47 +00:00
OI-codes/AtCoder/ARC148/A/A.cpp

32 lines
476 B
C++

#include <iostream>
#include <algorithm>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 2e5 + 5;
int n, a[N], ans;
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
std::sort(a + 1, a + 1 + n);
for (int i = 2; i <= n; i++) {
ans = std::__gcd(ans, a[i] - a[i - 1]);
}
cout << (ans == 1 ? 2 : 1) << endl;
return 0;
}