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