結果
問題 | No.135 とりあえず1次元の問題 |
ユーザー |
|
提出日時 | 2015-01-25 23:23:09 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 44 ms / 5,000 ms |
コード長 | 447 bytes |
コンパイル時間 | 1,556 ms |
コンパイル使用メモリ | 157,964 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-03 02:58:11 |
合計ジャッジ時間 | 2,860 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; #define REP(i, n) for(int(i)=0;(i)<(n);++(i)) const int MOD = int(1e9+7); int A[111111]; int main(){ int N; cin >> N; REP(i,N) cin >> A[i]; sort(A,A+N); int minv = 1<<29; REP(i,N-1) if(A[i+1]!=A[i]) minv = min(minv, A[i+1]-A[i]); if(minv==1<<29)minv=0; cout << minv << endl; return 0; }