結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
カニ戯(ry
|
| 提出日時 | 2015-02-24 16:28:57 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 727 ms / 5,000 ms |
| コード長 | 379 bytes |
| コンパイル時間 | 2,858 ms |
| コンパイル使用メモリ | 85,348 KB |
| 実行使用メモリ | 60,588 KB |
| 最終ジャッジ日時 | 2025-01-03 05:24:59 |
| 合計ジャッジ時間 | 10,603 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] a) {
Scanner s = new Scanner(System.in);
int N=s.nextInt(),i=0,d,m=Integer.MAX_VALUE;
int[] X=new int[N];
for(;i<N;)X[i++]=s.nextInt();
Arrays.sort(X);
for(i=0;i<N-1;)m=((d=Math.abs(X[i]-X[++i]))>0&&d<m)?d:m;
System.out.println(m==Integer.MAX_VALUE?0:m);
}
}
カニ戯(ry