結果

問題 No.135 とりあえず1次元の問題
ユーザー gotutiyan
提出日時 2017-10-21 00:00:56
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 854 bytes
コンパイル時間 722 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-21 10:53:45
合計ジャッジ時間 1,648 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define repp(i,j,k) for(int i=j;i>=k;i--)
#define llrep(i,j,k) for(long long int i=j;i<(long long int)k;i++)
#define Sort(x) sort(x.begin(),x.end()); 
#define vi vector<int>
#define vvi vector<vector<int>> 
#define ll long long
int mod=1e9+7;
const int INF = 100000000;

using namespace std;

void p(int x) {
	cout << x << endl;
}

void pp(string s) {
	cout << s << endl;
}




int main(void) {
	int n;
	cin >> n;
	int x, xx;
	int minn = INF;
	cin >> x;
	rep(i, 1, n) {
		xx = x;
		cin >> x;
		if(x-xx!=0)minn = min(minn, abs(x - xx));
	}
	
	cout << minn << endl;
	return 0;
}
0