結果

問題 No.406 鴨等間隔の法則
ユーザー mondomondo
提出日時 2019-08-09 18:16:13
言語 PHP
(8.3.4)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 1,083 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 28,476 KB
最終ジャッジ日時 2023-09-21 19:06:53
合計ジャッジ時間 4,973 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
18,416 KB
testcase_01 AC 7 ms
12,284 KB
testcase_02 AC 6 ms
12,284 KB
testcase_03 AC 6 ms
12,208 KB
testcase_04 AC 139 ms
22,420 KB
testcase_05 AC 53 ms
18,284 KB
testcase_06 AC 55 ms
18,364 KB
testcase_07 AC 56 ms
18,244 KB
testcase_08 AC 140 ms
22,524 KB
testcase_09 AC 154 ms
22,340 KB
testcase_10 AC 64 ms
18,284 KB
testcase_11 AC 119 ms
22,336 KB
testcase_12 AC 77 ms
18,276 KB
testcase_13 AC 71 ms
18,288 KB
testcase_14 AC 133 ms
26,452 KB
testcase_15 AC 12 ms
12,344 KB
testcase_16 AC 14 ms
12,248 KB
testcase_17 AC 10 ms
12,308 KB
testcase_18 AC 13 ms
12,224 KB
testcase_19 AC 17 ms
13,772 KB
testcase_20 AC 22 ms
13,872 KB
testcase_21 AC 22 ms
13,868 KB
testcase_22 AC 37 ms
15,824 KB
testcase_23 AC 81 ms
18,352 KB
testcase_24 AC 114 ms
26,440 KB
testcase_25 AC 155 ms
22,500 KB
testcase_26 AC 154 ms
28,472 KB
testcase_27 AC 122 ms
22,548 KB
testcase_28 AC 120 ms
22,456 KB
testcase_29 AC 160 ms
28,476 KB
testcase_30 AC 157 ms
28,464 KB
testcase_31 AC 147 ms
22,400 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 && count(array_unique($bird)) != 1 ? "YES" : "NO";
0