結果
| 問題 | No.135 とりあえず1次元の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-16 10:41:13 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 25 ms / 5,000 ms |
| + 56µs | |
| コード長 | 361 bytes |
| 記録 | |
| コンパイル時間 | 928 ms |
| コンパイル使用メモリ | 181,924 KB |
| 実行使用メモリ | 9,872 KB |
| 最終ジャッジ日時 | 2026-10-11 11:33:04 |
| 合計ジャッジ時間 | 2,377 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1<<30;
int main(){
int n;cin>>n;
vector<int> x(n);
for(int i=0;i<n;i++){
cin>>x[i];
}
sort(x.begin(), x.end());
int ans=INF;
for(int i=0;i<n-1;i++){
if(x[i+1]==x[i])continue;
ans = min(ans, x[i+1]-x[i]);
}
if(ans==INF)ans=0;
cout<<ans<<endl;
}