結果
問題 |
No.135 とりあえず1次元の問題
|
ユーザー |
![]() |
提出日時 | 2019-07-30 17:16:17 |
言語 | PHP (843.2) |
結果 |
TLE
|
実行時間 | - |
コード長 | 435 bytes |
コンパイル時間 | 939 ms |
コンパイル使用メモリ | 32,272 KB |
実行使用メモリ | 49,428 KB |
最終ジャッジ日時 | 2024-07-05 01:21:51 |
合計ジャッジ時間 | 13,190 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | TLE * 1 -- * 21 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php $n = trim(fgets(STDIN)); $num = explode(" ", trim(fgets(STDIN))); // $num = array_unique($number); sort($num); // print_r($num); $array = array(); $ans = 0; $ans2 = 0; for ($i = 0; $i < $n - 1; $i++) { $number = $num[$i+1] - $num[$i]; if($number > 0){ $array[] = $number; $ans = min($array); } else { $ans2 = $number; } } if(is_null($array)){ echo $ans2; } else { echo $ans; }