結果

問題 No.406 鴨等間隔の法則
ユーザー ayaaya
提出日時 2019-08-01 10:16:25
言語 PHP
(8.2.11)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 1,220 ms
コンパイル使用メモリ 18,560 KB
実行使用メモリ 27,112 KB
最終ジャッジ日時 2023-09-21 19:07:30
合計ジャッジ時間 5,356 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
22,836 KB
testcase_01 AC 16 ms
18,884 KB
testcase_02 AC 16 ms
18,928 KB
testcase_03 AC 16 ms
18,940 KB
testcase_04 AC 133 ms
27,012 KB
testcase_05 AC 54 ms
22,832 KB
testcase_06 AC 58 ms
22,856 KB
testcase_07 AC 57 ms
22,940 KB
testcase_08 AC 132 ms
27,084 KB
testcase_09 AC 143 ms
26,876 KB
testcase_10 AC 62 ms
22,940 KB
testcase_11 AC 113 ms
27,064 KB
testcase_12 AC 75 ms
22,916 KB
testcase_13 AC 72 ms
22,776 KB
testcase_14 AC 140 ms
27,016 KB
testcase_15 AC 20 ms
18,928 KB
testcase_16 AC 22 ms
18,932 KB
testcase_17 AC 18 ms
18,908 KB
testcase_18 AC 24 ms
18,860 KB
testcase_19 AC 26 ms
18,920 KB
testcase_20 AC 30 ms
18,932 KB
testcase_21 AC 28 ms
19,020 KB
testcase_22 AC 42 ms
20,816 KB
testcase_23 AC 78 ms
22,924 KB
testcase_24 AC 118 ms
27,072 KB
testcase_25 AC 142 ms
26,952 KB
testcase_26 AC 161 ms
27,036 KB
testcase_27 AC 111 ms
27,048 KB
testcase_28 AC 144 ms
27,112 KB
testcase_29 AC 161 ms
27,088 KB
testcase_30 AC 155 ms
26,940 KB
testcase_31 AC 134 ms
27,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$fuyou=trim(fgets(STDIN));
$duckPoint=explode(" ",trim(fgets(STDIN)));
sort($duckPoint);
$ans=(int)$duckPoint[1]-(int)$duckPoint[0];
for($i=1;$i<=count($duckPoint)-2;$i++){
  $duckLength=(int)$duckPoint[$i+1]-(int)$duckPoint[$i];
  if($ans!=$duckLength||$ans==0){
    $ans="NO";
    break;
  }
}
if(is_int($ans)){
  $ans="YES";
}
echo $ans;
0