結果

問題 No.135 とりあえず1次元の問題
ユーザー GoryudyumaGoryudyuma
提出日時 2015-03-08 02:37:50
言語 PHP
(8.3.4)
結果
AC  
実行時間 167 ms / 5,000 ms
コード長 251 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 18,548 KB
実行使用メモリ 37,044 KB
最終ジャッジ日時 2023-09-01 03:09:03
合計ジャッジ時間 2,800 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 167 ms
37,036 KB
testcase_01 AC 16 ms
18,764 KB
testcase_02 AC 16 ms
18,832 KB
testcase_03 AC 16 ms
18,784 KB
testcase_04 AC 16 ms
18,580 KB
testcase_05 AC 16 ms
18,856 KB
testcase_06 AC 16 ms
18,756 KB
testcase_07 AC 16 ms
18,856 KB
testcase_08 AC 16 ms
18,820 KB
testcase_09 AC 15 ms
18,764 KB
testcase_10 AC 15 ms
18,788 KB
testcase_11 AC 16 ms
18,788 KB
testcase_12 AC 16 ms
18,712 KB
testcase_13 AC 16 ms
18,912 KB
testcase_14 AC 16 ms
18,832 KB
testcase_15 AC 16 ms
18,776 KB
testcase_16 AC 17 ms
18,860 KB
testcase_17 AC 18 ms
18,776 KB
testcase_18 AC 16 ms
18,736 KB
testcase_19 AC 18 ms
18,788 KB
testcase_20 AC 17 ms
18,776 KB
testcase_21 AC 25 ms
28,820 KB
testcase_22 AC 162 ms
37,044 KB
evil01.txt AC 154 ms
37,036 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

$N=trim(fgets(STDIN));
$data= array_unique(explode(' ', trim(fgets(STDIN))));
sort($data);
$ans=PHP_INT_MAX;
for($i=0;$i<sizeof($data)-1;$i++){
    $ans=min($ans,$data[$i+1]-$data[$i]);
}
if($ans===PHP_INT_MAX){
    $ans=0;
}
echo $ans.PHP_EOL;
0