#include #include int main(void) { int N, i, j, X[100001], dmin; scanf("%d", &N); for(i = 1;i <= N;i++){ scanf("%d", &X[i]); } dmin = 1000001; for(i = 1;i <= N - 1;i++){ for(j = i + 1;j <= N;j++){ if(X[i] != X[j] && abs(X[i] - X[j]) < dmin)dmin = abs(X[i] - X[j]); } } if(dmin > 1000000)dmin = 0; printf("%d\n", dmin); return 0; }