結果

問題 No.135 とりあえず1次元の問題
ユーザー testtest
提出日時 2020-09-05 20:58:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 1,538 ms
コンパイル使用メモリ 172,748 KB
実行使用メモリ 8,500 KB
最終ジャッジ日時 2024-11-29 06:07:33
合計ジャッジ時間 2,965 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, ss, ee) for (int i = ss; i < ee; ++i)
using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N, x, ans = 1000001;
  cin >> N;
  set<int> s;
  vector<int> v;
  rep(i, 0, N) {
    cin >> x;
    s.emplace(x);
  }
  for (auto x : s) v.emplace_back(x);
  rep(i, 0, v.size() - 1) { ans = min(ans, v[i + 1] - v[i]); }
  cout << ans << endl;
  getchar();
}
0