結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
FVRChan
|
| 提出日時 | 2017-09-24 16:22:49 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 453 bytes |
| コンパイル時間 | 2,389 ms |
| コンパイル使用メモリ | 75,100 KB |
| 実行使用メモリ | 60,348 KB |
| 最終ジャッジ日時 | 2024-11-14 07:12:24 |
| 合計ジャッジ時間 | 10,440 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 WA * 1 |
ソースコード
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);
}
}
FVRChan