結果
問題 | No.135 とりあえず1次元の問題 |
ユーザー | not_522 |
提出日時 | 2015-07-14 23:55:14 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 42 ms / 5,000 ms |
コード長 | 319 bytes |
コンパイル時間 | 1,999 ms |
コンパイル使用メモリ | 162,824 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-03 06:08:32 |
合計ジャッジ時間 | 2,719 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> x(n); for (int& i : x) cin >> i; sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end()); adjacent_difference(x.begin(), x.end(), x.begin()); cout << *min_element(x.begin() + 1, x.end()) << endl; }