結果
問題 | No.135 とりあえず1次元の問題 |
ユーザー |
![]() |
提出日時 | 2019-07-17 00:16:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 77 ms / 5,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 1,824 ms |
コンパイル使用メモリ | 175,444 KB |
実行使用メモリ | 8,576 KB |
最終ジャッジ日時 | 2024-12-15 07:51:23 |
合計ジャッジ時間 | 3,465 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; set<int> st; for (int i = 0; i < n; ++i) { int t; cin >> t; st.insert(t); } vector<int> vt; adjacent_difference(st.begin(), st.end(), back_inserter(vt)); cout << *min_element(vt.begin() + 1, vt.end()) << endl; return 0; }