結果

問題 No.135 とりあえず1次元の問題
ユーザー takeya_okinotakeya_okino
提出日時 2017-07-14 13:41:56
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 289 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 30,788 KB
実行使用メモリ 40,820 KB
最終ジャッジ日時 2024-04-16 19:26:10
合計ジャッジ時間 2,572 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 41 ms
31,196 KB
testcase_03 AC 40 ms
30,980 KB
testcase_04 AC 40 ms
31,124 KB
testcase_05 AC 40 ms
30,800 KB
testcase_06 AC 40 ms
30,968 KB
testcase_07 AC 41 ms
30,980 KB
testcase_08 AC 40 ms
31,148 KB
testcase_09 WA -
testcase_10 AC 41 ms
31,184 KB
testcase_11 WA -
testcase_12 AC 41 ms
30,936 KB
testcase_13 AC 40 ms
31,112 KB
testcase_14 AC 41 ms
30,948 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 41 ms
31,072 KB
testcase_19 WA -
testcase_20 AC 41 ms
30,848 KB
testcase_21 AC 163 ms
40,820 KB
testcase_22 WA -
evil01.txt WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$N = trim(fgets(STDIN));
$X = explode(" ", trim(fgets(STDIN)));
sort($X);
$ans = 10000000;
$small = $X[0];
for($i = 0; $i < $N; $i++) {
  $x = $X[$i];
  if($x > $small) {
    $ans = min($ans, $x - $small);
    $small = $X[$i + 1];
  }
}
if($ans == 10000000) $ans = 0;
print($ans);
?>
0