結果
問題 | No.135 とりあえず1次元の問題 |
ユーザー | Lavender |
提出日時 | 2019-09-02 07:11:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 76 ms / 5,000 ms |
コード長 | 335 bytes |
コンパイル時間 | 1,826 ms |
コンパイル使用メモリ | 175,592 KB |
実行使用メモリ | 8,576 KB |
最終ジャッジ日時 | 2024-12-14 06:08:41 |
合計ジャッジ時間 | 2,847 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n; int temp; cin>>n; set<int> x; for(int i=0;i<n;i++){ cin>>temp; x.insert(temp); } vector<int> t; adjacent_difference(x.begin(), x.end(), back_inserter(t)); cout<<*min_element(t.begin()+1,t.end())<<endl; return 0; }