結果

問題 No.716 距離
ユーザー GrenacheGrenache
提出日時 2018-09-16 17:42:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 195 ms / 2,000 ms
コード長 860 bytes
コンパイル時間 3,384 ms
コンパイル使用メモリ 73,288 KB
実行使用メモリ 57,832 KB
最終ジャッジ日時 2023-09-25 09:02:53
合計ジャッジ時間 12,098 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 185 ms
55,568 KB
testcase_01 AC 185 ms
56,128 KB
testcase_02 AC 187 ms
56,268 KB
testcase_03 AC 188 ms
55,628 KB
testcase_04 AC 186 ms
56,804 KB
testcase_05 AC 187 ms
55,932 KB
testcase_06 AC 179 ms
57,140 KB
testcase_07 AC 125 ms
55,404 KB
testcase_08 AC 125 ms
55,680 KB
testcase_09 AC 127 ms
55,812 KB
testcase_10 AC 191 ms
56,124 KB
testcase_11 AC 182 ms
55,632 KB
testcase_12 AC 191 ms
56,032 KB
testcase_13 AC 185 ms
55,836 KB
testcase_14 AC 128 ms
55,708 KB
testcase_15 AC 195 ms
55,892 KB
testcase_16 AC 192 ms
56,760 KB
testcase_17 AC 183 ms
55,996 KB
testcase_18 AC 136 ms
55,824 KB
testcase_19 AC 181 ms
56,064 KB
testcase_20 AC 132 ms
55,632 KB
testcase_21 AC 148 ms
55,912 KB
testcase_22 AC 160 ms
55,880 KB
testcase_23 AC 139 ms
55,716 KB
testcase_24 AC 193 ms
56,244 KB
testcase_25 AC 177 ms
56,208 KB
testcase_26 AC 185 ms
56,056 KB
testcase_27 AC 188 ms
56,240 KB
testcase_28 AC 140 ms
55,648 KB
testcase_29 AC 188 ms
55,996 KB
testcase_30 AC 185 ms
55,620 KB
testcase_31 AC 193 ms
56,252 KB
testcase_32 AC 187 ms
56,056 KB
testcase_33 AC 191 ms
56,860 KB
testcase_34 AC 193 ms
55,876 KB
testcase_35 AC 131 ms
55,640 KB
testcase_36 AC 147 ms
55,904 KB
testcase_37 AC 131 ms
55,712 KB
testcase_38 AC 157 ms
56,052 KB
testcase_39 AC 187 ms
57,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder716 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();
		
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}

		int min = Integer.MAX_VALUE;
		for (int i = 1; i < n; i++) {
			min = Math.min(min, a[i] - a[i - 1]);
		}
		
		pr.println(min);
		pr.println(a[n - 1] - a[0]);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
0