結果

問題 No.135 とりあえず1次元の問題
ユーザー regulus
提出日時 2017-11-22 18:52:36
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 326 bytes
コンパイル時間 321 ms
コンパイル使用メモリ 30,080 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-26 11:20:01
合計ジャッジ時間 1,475 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

#define F(i,n) for(int i = 0;i < n;i++)
#define N 1000001

int main(void){
	int n,t,r=N;
	scanf("%d",&n);
	int a[n];
	F(i,n)scanf("%d",&a[i]);
	//z(a,a,n);
	F(i,n){
		if(i==n-1)break;
		t=a[i]-a[i+1];
		if(t!=0){
			if(t<0)t*=-1;
			if(r>t){
				r=t;
			}
		}
	}
	if(r==N)r=0;
	printf("%d",r);
	return 0;
}
0