結果

問題 No.135 とりあえず1次元の問題
ユーザー YatsukuYatsuku
提出日時 2015-12-11 23:44:04
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 2,251 ms
コンパイル使用メモリ 72,368 KB
実行使用メモリ 62,644 KB
最終ジャッジ日時 2023-09-01 22:53:33
合計ジャッジ時間 9,027 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 559 ms
60,096 KB
testcase_01 AC 129 ms
55,752 KB
testcase_02 AC 129 ms
55,844 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 141 ms
55,688 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 189 ms
55,484 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 584 ms
60,640 KB
evil01.txt AC 546 ms
60,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class No_135 {
	public static void main(String args[]) {

		Scanner stdIn = new Scanner(System.in);		

		int num = stdIn.nextInt();

		int x_axis[] = new int[num];

		for (int i = 0; i < num; i++) {
			x_axis[i]	= stdIn.nextInt();
		}

		int min = 100000;
		int tmp;
		for (int j = 0; j <= num - 2; j++) {
			if ( x_axis[j] == x_axis[j+1]) { continue; }
			tmp = Math.abs(x_axis[j] - x_axis[j+1]);	
			if ( tmp < min ) { min = tmp; }
		}

		System.out.println(min);

	}
}
0