結果

問題 No.135 とりあえず1次元の問題
ユーザー FVRChanFVRChan
提出日時 2017-09-24 16:22:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 2,240 ms
コンパイル使用メモリ 74,916 KB
実行使用メモリ 49,280 KB
最終ジャッジ日時 2024-04-26 17:35:53
合計ジャッジ時間 9,377 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 675 ms
49,152 KB
testcase_01 AC 119 ms
40,420 KB
testcase_02 AC 137 ms
41,324 KB
testcase_03 WA -
testcase_04 AC 135 ms
41,956 KB
testcase_05 AC 143 ms
42,132 KB
testcase_06 AC 135 ms
41,500 KB
testcase_07 AC 137 ms
41,460 KB
testcase_08 AC 134 ms
41,700 KB
testcase_09 AC 142 ms
42,076 KB
testcase_10 AC 134 ms
41,324 KB
testcase_11 AC 135 ms
41,540 KB
testcase_12 AC 164 ms
41,764 KB
testcase_13 AC 142 ms
42,072 KB
testcase_14 AC 186 ms
42,200 KB
testcase_15 AC 156 ms
42,064 KB
testcase_16 AC 186 ms
42,408 KB
testcase_17 AC 184 ms
42,204 KB
testcase_18 AC 145 ms
42,408 KB
testcase_19 AC 181 ms
42,836 KB
testcase_20 AC 174 ms
41,936 KB
testcase_21 AC 553 ms
48,732 KB
testcase_22 AC 730 ms
49,280 KB
evil01.txt AC 683 ms
49,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;
public class Main{
	public static void main(String args[])throws Exception{
		Scanner sc=new Scanner(System.in);
		int n=Integer.parseInt(sc.nextLine());
		int are[]=new int[n];
		int min=999999999;
		for(int i=0;i<n;i++)are[i]=sc.nextInt();
		Arrays.sort(are);
		for(int i=0;i<are.length-1;i++)
			if(are[i] != are[i+1])
				min=Math.min(min,Math.abs(are[i]-are[i+1]));
		System.out.println(min);
	}
}
0