結果
問題 | No.716 距離 |
ユーザー |
![]() |
提出日時 | 2018-09-07 09:36:24 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 411 bytes |
コンパイル時間 | 2,135 ms |
コンパイル使用メモリ | 160,360 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 00:06:46 |
合計ジャッジ時間 | 3,530 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 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 << " " << (a[N-1]-a[0]) << endl; return 0; }