結果
問題 | No.716 距離 |
ユーザー |
![]() |
提出日時 | 2018-07-27 23:07:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 433 bytes |
コンパイル時間 | 1,448 ms |
コンパイル使用メモリ | 169,164 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 04:41:24 |
合計ジャッジ時間 | 2,613 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 40 |
ソースコード
#include <bits/stdc++.h>#define rep(i, a, n) for(int i = a; i < n; i++)#define int long longusing namespace std;typedef pair<int, int> P;const int INF = 1e15;signed main(){int n;cin >> n;vector<int> a(n);rep(i, 0, n){cin >> a[i];}int MAX = a[n - 1] - a[0];int MIN = MAX;rep(i, 0, n - 1){MIN = min(MIN, a[i + 1] - a[i]);}cout << MIN << endl << MAX << endl;}