結果

問題 No.135 とりあえず1次元の問題
ユーザー d_nishiyama85d_nishiyama85
提出日時 2015-05-04 12:13:59
言語 PHP
(8.3.4)
結果
AC  
実行時間 147 ms / 5,000 ms
コード長 330 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 18,728 KB
実行使用メモリ 27,028 KB
最終ジャッジ日時 2023-09-01 03:20:45
合計ジャッジ時間 2,118 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 147 ms
26,920 KB
testcase_01 AC 15 ms
18,784 KB
testcase_02 AC 15 ms
18,988 KB
testcase_03 AC 15 ms
18,896 KB
testcase_04 AC 16 ms
18,956 KB
testcase_05 AC 15 ms
18,948 KB
testcase_06 AC 14 ms
18,912 KB
testcase_07 AC 15 ms
18,964 KB
testcase_08 AC 14 ms
18,960 KB
testcase_09 AC 17 ms
18,872 KB
testcase_10 AC 15 ms
18,948 KB
testcase_11 AC 15 ms
18,932 KB
testcase_12 AC 17 ms
18,848 KB
testcase_13 AC 15 ms
18,860 KB
testcase_14 AC 15 ms
18,884 KB
testcase_15 AC 15 ms
18,936 KB
testcase_16 AC 16 ms
18,892 KB
testcase_17 AC 16 ms
18,784 KB
testcase_18 AC 15 ms
18,896 KB
testcase_19 AC 15 ms
18,960 KB
testcase_20 AC 16 ms
18,912 KB
testcase_21 AC 117 ms
26,996 KB
testcase_22 AC 147 ms
27,028 KB
evil01.txt AC 140 ms
26,932 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$N = trim(fgets(STDIN));

$points = explode(' ', trim(fgets(STDIN)));

sort($points);

$min = PHP_INT_MAX;

for($i = 0, $c = count($points); $i < $c - 1; $i++) {
	if (($diff = $points[$i+1] - $points[$i]) > 0) {
		$min = min($min, $diff);
	}
}

if ($min == PHP_INT_MAX || $min == 0) {
	echo "0\n";
} else {
	echo "$min\n";
}
0