結果
問題 |
No.716 距離
|
ユーザー |
![]() |
提出日時 | 2019-06-03 16:31:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 260 bytes |
コンパイル時間 | 1,377 ms |
コンパイル使用メモリ | 160,376 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-17 20:33:16 |
合計ジャッジ時間 | 2,183 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 40 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; vector<int> a(N); for(int i=0;i<N;i++)cin >> a[i]; int M=a[N-1]-a[0]; int m=a[1]-a[0]; for(int i=2;i<N;i++)m=min(m,a[i]-a[i-1]); cout << m << endl; cout << M << endl; }