結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-17 05:22:13 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
AC
|
| 実行時間 | 39 ms / 5,000 ms |
| コード長 | 397 bytes |
| コンパイル時間 | 995 ms |
| コンパイル使用メモリ | 115,248 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-12 20:12:03 |
| 合計ジャッジ時間 | 2,139 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
import std.stdio, std.string, std.conv, std.algorithm;
import std.range, std.array, std.container, std.math, std.typecons;
immutable int mod = 10^^9 + 7;
int N;
int[] x;
void main() {
N = readln.chomp.to!int;
x = readln.split.to!(int[]).sort().uniq.array;
N = x.length.to!int;
if (x.length == 1) writeln(0);
else iota(N - 1).map!(i => x[i + 1] - x[i]).minElement.writeln;
}