結果
問題 |
No.716 距離
|
ユーザー |
|
提出日時 | 2018-07-27 23:26:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 358 bytes |
コンパイル時間 | 478 ms |
コンパイル使用メモリ | 70,904 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-05 05:16:56 |
合計ジャッジ時間 | 1,484 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 WA * 38 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> a(n); int mn = 1e9, mx = -1e9; for (int i = 0; i < n; i++) { cin >> a[i]; if (i > 0) { mn = min(mn, a[i] - a[i - 1]); mx = max(mx, a[i] - a[i - 1]); } } cout << mn << endl; cout << mx << endl; }