結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
spacia
|
| 提出日時 | 2015-12-23 14:09:58 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 640 bytes |
| コンパイル時間 | 2,843 ms |
| コンパイル使用メモリ | 76,468 KB |
| 実行使用メモリ | 52,336 KB |
| 最終ジャッジ日時 | 2025-01-03 10:58:40 |
| 合計ジャッジ時間 | 6,124 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 WA * 1 |
ソースコード
import java.io.*;
import java.util.*;
class Main135 {
public static void out (Object o) {
System.out.println(o);
}
public static void main (String[] args) throws IOException {
BufferedReader br =
new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
String[] line = br.readLine().split(" ");
int[] nums = new int[n];
for (int i = 0; i < n; i++) nums[i] = Integer.parseInt(line[i]);
int ans = Integer.MAX_VALUE;
Arrays.sort(nums);
for (int i = 1; i < n; i++) {
int sub = nums[i] - nums[i - 1];
if (sub != 0 && sub < ans) ans = sub;
}
out(ans);
}
}
spacia