結果

問題 No.406 鴨等間隔の法則
ユーザー kagikakko_karikagikakko_kari
提出日時 2016-09-12 23:23:37
言語 PHP
(8.3.4)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 644 ms
コンパイル使用メモリ 18,404 KB
実行使用メモリ 33,132 KB
最終ジャッジ日時 2023-09-21 18:12:23
合計ジャッジ時間 4,881 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
24,864 KB
testcase_01 AC 15 ms
18,796 KB
testcase_02 AC 14 ms
18,892 KB
testcase_03 AC 15 ms
18,836 KB
testcase_04 AC 147 ms
33,132 KB
testcase_05 AC 60 ms
24,836 KB
testcase_06 AC 64 ms
24,796 KB
testcase_07 AC 63 ms
24,788 KB
testcase_08 AC 144 ms
33,032 KB
testcase_09 AC 158 ms
32,988 KB
testcase_10 AC 69 ms
24,760 KB
testcase_11 AC 126 ms
33,124 KB
testcase_12 AC 84 ms
24,880 KB
testcase_13 AC 80 ms
24,848 KB
testcase_14 AC 133 ms
33,064 KB
testcase_15 AC 19 ms
18,888 KB
testcase_16 AC 22 ms
18,804 KB
testcase_17 AC 18 ms
18,836 KB
testcase_18 AC 23 ms
18,900 KB
testcase_19 AC 25 ms
20,904 KB
testcase_20 AC 30 ms
20,896 KB
testcase_21 AC 29 ms
20,792 KB
testcase_22 AC 43 ms
22,860 KB
testcase_23 AC 89 ms
26,984 KB
testcase_24 AC 118 ms
31,040 KB
testcase_25 AC 160 ms
33,072 KB
testcase_26 AC 158 ms
33,068 KB
testcase_27 AC 127 ms
33,124 KB
testcase_28 AC 161 ms
33,112 KB
testcase_29 AC 157 ms
33,096 KB
testcase_30 AC 154 ms
33,104 KB
testcase_31 AC 152 ms
33,076 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$N = trim(fgets(STDIN));
$x = explode(" ",trim(fgets(STDIN)));
sort($x);

for($i = 0;$i <= $N - 2;$i++){
    $d[$i] = $x[$i + 1] - $x[$i];
}

$d = array_count_values($d);
$count = count($d);
if(isset($d[0]) == false && $count == 1){
    echo "YES" . PHP_EOL ;
}else{
    echo "NO" . PHP_EOL ;
}
?>
0