結果

問題 No.716 距離
ユーザー Mcpu3
提出日時 2018-07-28 10:04:59
言語 Java
(openjdk 23)
結果
AC  
実行時間 185 ms / 2,000 ms
コード長 309 bytes
コンパイル時間 2,014 ms
コンパイル使用メモリ 76,752 KB
実行使用メモリ 44,824 KB
最終ジャッジ日時 2024-07-05 18:17:05
合計ジャッジ時間 9,480 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int n=stdIn.nextInt(),a=0,b=stdIn.nextInt(),t=b,m=200000,i;
		for(i=1;i<n;i++) {
			a=stdIn.nextInt();
			if(m>a-t) m=a-t;
			t=a;
		}
		System.out.print(m+"\n"+(a-b));
	}
}
0