#include #include int N; int main(){ //input scanf("%d",&N); int X[N]; for (int i = 0;i < N;i++){ scanf("%d",&X[i]); } //sort X array std::sort(X,X+N); //search int min = 1000000; for (int i = 0;i <= N-2;i++){ if (X[i] != X[i+1] && X[i+1]-X[i] < min){ min = X[i+1]-X[i]; } } //ouput printf("%d\n",min); return 0; }