#include #include int main(void){ int i, j; int N, X[100000]; int min, tmp; min = 0x7FFFFFFF; scanf("%d", &N); for(i = 0 ; i < N; i++){ scanf("%d", &X[i]); for(j = 0; j < i; j++){ if(X[j] != X[i]){ tmp = abs(X[j] - X[i]); if(min > tmp) min = tmp; } } } if(min == 0x7FFFFFFF) printf("0\n"); else printf("%d\n", min); return 0; }