結果

問題 No.716 距離
ユーザー YamaKasaYamaKasa
提出日時 2018-07-27 22:25:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 189 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 2,127 ms
コンパイル使用メモリ 71,176 KB
実行使用メモリ 56,712 KB
最終ジャッジ日時 2023-09-18 09:34:06
合計ジャッジ時間 10,172 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 181 ms
55,872 KB
testcase_01 AC 182 ms
56,436 KB
testcase_02 AC 183 ms
56,124 KB
testcase_03 AC 183 ms
56,388 KB
testcase_04 AC 189 ms
56,368 KB
testcase_05 AC 181 ms
56,712 KB
testcase_06 AC 181 ms
56,252 KB
testcase_07 AC 121 ms
55,948 KB
testcase_08 AC 120 ms
55,580 KB
testcase_09 AC 121 ms
55,860 KB
testcase_10 AC 180 ms
56,084 KB
testcase_11 AC 174 ms
55,992 KB
testcase_12 AC 185 ms
56,172 KB
testcase_13 AC 179 ms
55,824 KB
testcase_14 AC 120 ms
55,892 KB
testcase_15 AC 180 ms
56,228 KB
testcase_16 AC 173 ms
56,136 KB
testcase_17 AC 181 ms
56,200 KB
testcase_18 AC 134 ms
55,544 KB
testcase_19 AC 173 ms
55,528 KB
testcase_20 AC 124 ms
55,728 KB
testcase_21 AC 136 ms
55,708 KB
testcase_22 AC 148 ms
55,692 KB
testcase_23 AC 132 ms
56,296 KB
testcase_24 AC 180 ms
56,044 KB
testcase_25 AC 172 ms
56,064 KB
testcase_26 AC 177 ms
55,904 KB
testcase_27 AC 177 ms
55,964 KB
testcase_28 AC 131 ms
55,808 KB
testcase_29 AC 175 ms
55,616 KB
testcase_30 AC 174 ms
55,692 KB
testcase_31 AC 178 ms
56,184 KB
testcase_32 AC 176 ms
56,188 KB
testcase_33 AC 176 ms
56,016 KB
testcase_34 AC 175 ms
56,632 KB
testcase_35 AC 123 ms
55,572 KB
testcase_36 AC 150 ms
55,404 KB
testcase_37 AC 127 ms
55,720 KB
testcase_38 AC 159 ms
56,020 KB
testcase_39 AC 179 ms
56,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int []a = new int[N];
		for(int i = 0; i < N; i++) {
			a[i] = scan.nextInt();
		}
		scan.close();

		int max = a[N - 1] - a[0];
		int min = Integer.MAX_VALUE;
		for(int i = 0; i < N - 1; i++) {
			if(min > a[i + 1] - a[i]) {
				min = a[i + 1] - a[i];
			}
		}
		System.out.println(min);
		System.out.println(max);
	}
}
0