結果
| 問題 | No.135 とりあえず1次元の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-16 10:40:06 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 388 bytes |
| コンパイル時間 | 1,373 ms |
| コンパイル使用メモリ | 161,916 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-30 04:29:25 |
| 合計ジャッジ時間 | 2,480 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 WA * 1 |
ソースコード
#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());
if(n==1)cout<<0<<endl;
else{
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]);
}
cout<<ans<<endl;
}
}