結果
| 問題 | No.716 距離 | 
| コンテスト | |
| ユーザー |  xxxasdfghjk | 
| 提出日時 | 2018-09-07 09:37:31 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 420 bytes | 
| コンパイル時間 | 1,638 ms | 
| コンパイル使用メモリ | 159,976 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-26 00:20:24 | 
| 合計ジャッジ時間 | 2,735 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 40 | 
ソースコード
#include<bits/stdc++.h>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
int main()
{
  int m=99999999,N,a[1001];
  cin >> N;
  REP(i,N)cin >> a[i];
  sort(a,a+N);
  REP(i,N-1)m = min(m,a[i+1]-a[i]);
  cout << m << endl;
  cout << (a[N-1]-a[0])  << endl;
  return 0;
}
            
            
            
        