結果

問題 No.406 鴨等間隔の法則
ユーザー mondomondo
提出日時 2019-08-09 18:13:17
言語 PHP
(8.2.11)
結果
WA  
実行時間 -
コード長 237 bytes
コンパイル時間 496 ms
コンパイル使用メモリ 12,040 KB
実行使用メモリ 22,532 KB
最終ジャッジ日時 2023-09-26 13:18:55
合計ジャッジ時間 5,682 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
18,324 KB
testcase_01 AC 7 ms
12,208 KB
testcase_02 AC 9 ms
12,204 KB
testcase_03 WA -
testcase_04 AC 144 ms
22,340 KB
testcase_05 AC 54 ms
18,240 KB
testcase_06 AC 57 ms
18,240 KB
testcase_07 AC 58 ms
18,264 KB
testcase_08 AC 143 ms
22,352 KB
testcase_09 AC 154 ms
22,424 KB
testcase_10 AC 63 ms
18,284 KB
testcase_11 AC 120 ms
22,336 KB
testcase_12 AC 77 ms
18,240 KB
testcase_13 AC 73 ms
18,236 KB
testcase_14 AC 130 ms
22,356 KB
testcase_15 WA -
testcase_16 AC 15 ms
12,220 KB
testcase_17 AC 11 ms
12,248 KB
testcase_18 AC 14 ms
12,208 KB
testcase_19 AC 17 ms
13,732 KB
testcase_20 AC 22 ms
13,744 KB
testcase_21 AC 23 ms
13,696 KB
testcase_22 AC 36 ms
15,800 KB
testcase_23 AC 84 ms
18,256 KB
testcase_24 AC 114 ms
22,260 KB
testcase_25 AC 165 ms
22,364 KB
testcase_26 AC 159 ms
22,468 KB
testcase_27 WA -
testcase_28 AC 122 ms
22,412 KB
testcase_29 AC 162 ms
22,344 KB
testcase_30 AC 165 ms
22,300 KB
testcase_31 AC 152 ms
22,424 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$count = trim(fgets(STDIN));
$bird = explode(" ", trim(fgets(STDIN)));
rsort($bird);
$diff = array();
for ($i = 0; $i < $count-1; $i++) {
    $diff[] = $bird[$i] - $bird[$i+1];
}
echo count(array_unique($diff)) == 1 ? "YES" : "NO";
0