結果
問題 |
No.135 とりあえず1次元の問題
|
ユーザー |
![]() |
提出日時 | 2019-07-30 17:24:06 |
言語 | PHP (843.2) |
結果 |
WA
|
実行時間 | - |
コード長 | 333 bytes |
コンパイル時間 | 2,333 ms |
コンパイル使用メモリ | 31,888 KB |
実行使用メモリ | 42,612 KB |
最終ジャッジ日時 | 2024-07-05 01:38:30 |
合計ジャッジ時間 | 3,491 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | AC * 1 WA * 21 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?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;