結果
| 問題 |
No.716 距離
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-07-30 19:48:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 476 bytes |
| コンパイル時間 | 1,872 ms |
| コンパイル使用メモリ | 165,180 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 09:50:56 |
| 合計ジャッジ時間 | 3,103 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 40 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define fastcin {\
cin.tie(0);\
ios::sync_with_stdio(false);\
}
#define rep(i, a, b) for(int i = a; i < b; i++)
#define print(x) cout << x << "\n"
const int inf = 1e9+7;
int main() {
fastcin;
int n, ai, aib, ma, mi = inf;
cin >> n >> aib;
ma = aib;
rep(i, 1, n) {
cin >> ai;
mi = min(mi, ai-aib);
aib = ai;
}
ma = aib - ma;
print(mi);
print(ma);
return 0;
}