0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-27 16:56:26 +00:00
Baoshuo Ren 2022-09-26 16:52:44 +08:00
parent c9d9bc6254
commit 6e6213f281
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

31
AtCoder/ARC148/A/A.cpp Normal file
View File

@ -0,0 +1,31 @@
#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;
}