问题描述:
#include<bits/stdc++.h>
typedef long long ll;
#define mem(a) memset(a, 0, sizeof(a))
using namespace std;
int a[111];
int main()
{
int n;
cin >> n;
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
int ans = 1;
while (true) {
set<int> appended;
for (int i = 0; i < n; i++) {
if (appended.count(a[i] % ans)) {
goto loop;
}
appended.insert(a[i] % ans);
}
printf("%d",ans);
break;
loop:
ans++;
}
return 0;
}