結果

問題 No.135 とりあえず1次元の問題
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-20 15:41:33
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 459 bytes
コンパイル時間 2,107 ms
コンパイル使用メモリ 74,932 KB
実行使用メモリ 63,044 KB
最終ジャッジ日時 2024-05-01 07:54:59
合計ジャッジ時間 23,921 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 135 ms
41,136 KB
testcase_02 AC 137 ms
41,464 KB
testcase_03 WA -
testcase_04 AC 150 ms
41,836 KB
testcase_05 AC 149 ms
41,408 KB
testcase_06 AC 147 ms
41,352 KB
testcase_07 AC 151 ms
41,320 KB
testcase_08 AC 149 ms
41,744 KB
testcase_09 AC 144 ms
41,928 KB
testcase_10 AC 142 ms
41,248 KB
testcase_11 AC 146 ms
41,712 KB
testcase_12 AC 168 ms
41,616 KB
testcase_13 AC 152 ms
41,508 KB
testcase_14 AC 222 ms
42,572 KB
testcase_15 AC 170 ms
41,832 KB
testcase_16 AC 222 ms
42,356 KB
testcase_17 AC 216 ms
42,592 KB
testcase_18 AC 148 ms
41,888 KB
testcase_19 AC 211 ms
42,136 KB
testcase_20 AC 202 ms
42,484 KB
testcase_21 TLE -
testcase_22 -- -
evil01.txt -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] x = new int[n];
		int ans = 1001001001;
		for(int i = 0 ; i < n ; i++) x[i] = sc.nextInt();
		for(int i = 0 ; i < n ; i++) {
			for(int j = i + 1 ; j < n ; j++) {
				if(Math.abs(x[i] - x[j]) != 0) {
					ans = Math.min(ans, Math.abs(x[i] - x[j]));
				}
			}
		}
		System.out.println(ans);
 	}
}

0