結果

問題 No.135 とりあえず1次元の問題
コンテスト
ユーザー mondo
提出日時 2019-07-30 17:24:06
言語 PHP
(8.5.4)
コンパイル:
php -l _filename_
実行:
php _filename_
結果
WA  
実行時間 -
コード長 333 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 441 ms
コンパイル使用メモリ 36,388 KB
実行使用メモリ 46,364 KB
最終ジャッジ日時 2026-03-26 08:16:52
合計ジャッジ時間 2,550 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 1 WA * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #
raw source code

<?php
$n = trim(fgets(STDIN));
$num = explode(" ", trim(fgets(STDIN)));
// $num = array_unique($number);
sort($num);
$ans = 0;
for ($i = 0; $i < $i-1; $i++) {
     $number = $num[$i+1] - $num[$i];
     if($ans = 0){
        $ans = $number;
     } elseif ($number < $ans && $number != 0) {
         $ans = $number;
     }
}
echo $ans;
0