結果

問題 No.406 鴨等間隔の法則
ユーザー ayaaya
提出日時 2019-08-01 10:15:39
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 346 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 18,664 KB
実行使用メモリ 27,144 KB
最終ジャッジ日時 2023-09-18 17:18:08
合計ジャッジ時間 4,214 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 16 ms
18,884 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 138 ms
26,828 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 25 ms
18,868 KB
testcase_20 AC 30 ms
18,848 KB
testcase_21 WA -
testcase_22 AC 44 ms
20,636 KB
testcase_23 WA -
testcase_24 AC 122 ms
26,940 KB
testcase_25 WA -
testcase_26 AC 168 ms
26,932 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 167 ms
26,960 KB
testcase_30 AC 165 ms
27,024 KB
testcase_31 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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="NO";
    break;
  }
}
if(is_int($ans)||$ans==0){
  $ans="YES";
}
echo $ans;
0