#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int i, j; long n; vectorx; cin >> n; for (i = 0; i < n; i++) { long num; cin >> num; x.push_back(num); } sort(x.begin(), x.end()); long minn = 999999999; for (i = 0; i < n-1; i++) { if (x[i + 1] == x[i]) { } else { minn = min(minn, x[i + 1] - x[i]); } } cout << minn << endl; getchar(); getchar(); return 0; }