/* -*- coding: utf-8 -*- * * 135.cc: No.135 とりあえず1次元の問題 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 100000; const int INF = 1 << 30; /* typedef */ /* global variables */ int xs[MAX_N]; /* subroutines */ /* main */ int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> xs[i]; sort(xs, xs + n); int mind = INF; for (int i = 1; i < n; i++) { int d = xs[i] - xs[i - 1]; if (d > 0 && mind > d) mind = d; } printf("%d\n", mind < INF ? mind : 0); return 0; }