結果

問題 No.716 距離
ユーザー nyan68682154
提出日時 2019-06-14 23:37:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 506 bytes
コンパイル時間 636 ms
コンパイル使用メモリ 71,308 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-14 13:49:53
合計ジャッジ時間 2,033 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

//neko.cpp
#include<iostream>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<string>
#include<cstdio>
#include<stack>
#include<algorithm>
#include <map>
#include <stdio.h>
#include <vector>
#include <stdio.h>
#include <time.h>

using namespace std;
int main() {
	int N, b,c;
	int a[1000];
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}
	b = a[1] - a[0];
	for (int i = 0; i < N - 1; i++) {
		b = min(a[i + 1] - a[i], b);
	}
	cout << b << endl;
	cout << a[N - 1] - a[0] << endl;
}
0